Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove restriction on isize/usize in repr(simd) #59201

Merged

Conversation

lambda
Copy link
Contributor

@lambda lambda commented Mar 15, 2019

As discussed in #55078, there's no known reason for this restriction.

It's unlikely that repr(simd) will be stabilized in its current form, but
might as well remove some restrictions on it.

This removes the branch in is_machine which returns false for these types.
is_machine is only used for the repr(simd) type validation check.

@rust-highfive
Copy link
Collaborator

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 15, 2019
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:19b38dc0:start=1552629816587646881,finish=1552629817544235677,duration=956588796
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
Setting environment variables from .travis.yml
---
[01:14:15] .................................................................................................... 4400/5467
[01:14:18] .................................................................................................... 4500/5467
[01:14:22] .................................................................................................... 4600/5467
[01:14:27] ...........i........................................................................................ 4700/5467
[01:14:32] .................................................................F.................................. 4800/5467
[01:14:40] .................................................................................................... 5000/5467
[01:14:43] .................................................................................................... 5100/5467
[01:14:47] .................................................................................................... 5200/5467
[01:14:50] .................................................................................................... 5300/5467
[01:14:50] .................................................................................................... 5300/5467
[01:14:53] .................................................................................................... 5400/5467
[01:14:55] .....i.............................................................
[01:14:55] failures:
[01:14:55] 
[01:14:55] ---- [ui] ui/simd-type.rs stdout ----
[01:14:55] diff of stderr:
[01:14:55] 
[01:14:55] 10 LL | struct i64f64(i64, f64);
[01:14:55] 11    | ^^^^^^^^^^^^^^^^^^^^^^^^ SIMD elements must have the same type
[01:14:55] 12 
[01:14:55] - error[E0077]: SIMD vector element type should be machine type
[01:14:55] -    |
[01:14:55] -    |
[01:14:55] - LL | struct int4(isize, isize, isize, isize);
[01:14:55] + error: aborting due to 2 previous errors
[01:14:55] 18 
[01:14:55] - error: aborting due to 3 previous errors
[01:14:55] - 
[01:14:55] - 
[01:14:55] - Some errors occurred: E0075, E0076, E0077.
[01:14:55] + Some errors occurred: E0075, E0076.
[01:14:55] 22 For more information about an error, try `rustc --explain E0075`.
[01:14:55] 23 
[01:14:55] 
[01:14:55] 
[01:14:55] The actual stderr differed from the expected stderr.
[01:14:55] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/simd-type/simd-type.stderr
[01:14:55] To update references, rerun the tests and pass the `--bless` flag
[01:14:55] To only update this specific test, also pass `--test-args simd-type.rs`
[01:14:55] error: 1 errors occurred comparing output.
[01:14:55] status: exit code: 1
[01:14:55] status: exit code: 1
[01:14:55] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/simd-type.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/simd-type/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/simd-type/auxiliary" "-A" "unused"
[01:14:55] ------------------------------------------
[01:14:55] 
[01:14:55] ------------------------------------------
[01:14:55] stderr:
[01:14:55] stderr:
[01:14:55] ------------------------------------------
[01:14:55] {"message":"SIMD vector cannot be empty","code":{"code":"E0075","explanation":"\nThe `#[simd]` attribute can only be applied to non empty tuple structs, because\nit doesn't make sense to try to use SIMD operations when there are no values to\noperate on.\n\nThis will cause an error:\n\n```compile_fail,E0075\n#![feature(repr_simd)]\n\n#[repr(simd)]\nstruct Bad;\n```\n\nThis will not:\n\n```\n#![feature(repr_simd)]\n\n#[repr(simd)]\nstruct Good(u32);\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/simd-type.rs","byte_start":70,"byte_end":83,"line_start":5,"line_end":5,"column_start":1,"column_end":14,"is_primary":true,"text":[{"text":"struct empty; //~ ERROR SIMD vector cannot be empty","highlight_start":1,"highlight_end":14}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0075]: SIMD vector cannot be empty\n  --> /checkout/src/test/ui/simd-type.rs:5:1\n   |\nLL | struct empty; //~ ERROR SIMD vector cannot be empty\n   | ^^^^^^^^^^^^^\n\n"}
[01:14:55] {"message":"SIMD vector should be homogeneous","code":{"code":"E0076","explanation":"\nWhen using the `#[simd]` attribute to automatically use SIMD operations in tuple\nstruct, the types in the struct must all be of the same type, or the compiler\nwill trigger this error.\n\nThis will cause an error:\n\n```compile_fail,E0076\n#![feature(repr_simd)]\n\n#[repr(simd)]\nstruct Bad(u16, u32, u32);\n```\n\nThis will not:\n\n```\n#![feature(repr_simd)]\n\n#[repr(simd)]\nstruct Good(u32, u32, u32);\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/simd-type.rs","byte_start":137,"byte_end":161,"line_start":8,"line_end":8,"column_start":1,"column_end":25,"is_primary":true,"text":[{"text":"struct i64f64(i64, f64); //~ ERROR SIMD vector should be homogeneous","highlight_start":1,"highlight_end":25}],"label":"SIMD elements must have the same type","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0076]: SIMD vector should be homogeneous\n  --> /checkout/src/test/ui/simd-type.rs:8:1\n   |\nLL | struct i64f64(i64, f64); //~ ERROR SIMD vector should be homogeneous\n   | ^^^^^^^^^^^^^^^^^^^^^^^^ SIMD elements must have the same type\n\n"}
[01:14:55] {"message":"aborting due to 2 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 2 previous errors\n\n"}
[01:14:55] {"message":"Some errors occurred: E0075, E0076.","code":null,"level":"","spans":[],"children":[],"rendered":"Some errors occurred: E0075, E0076.\n"}
[01:14:55] 
[01:14:55] ------------------------------------------
[01:14:55] 
[01:14:55] thread '[ui] ui/simd-type.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3325:9
---
[01:14:55] 
[01:14:55] thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:496:22
[01:14:55] 
[01:14:55] 
[01:14:55] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-6.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "6.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[01:14:55] 
[01:14:55] 
[01:14:55] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:14:55] Build completed unsuccessfully in 0:04:28
[01:14:55] Build completed unsuccessfully in 0:04:28
[01:14:55] make: *** [check] Error 1
[01:14:55] Makefile:48: recipe for target 'check' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:0ded0401
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Fri Mar 15 07:18:44 UTC 2019

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

As discussed in rust-lang#55078, there's no known reason for this restriction.

It's unlikely that repr(simd) will be stabilized in its current form, but
might as well remove some restrictions on it.

This removes the branch in `is_machine` which returns false for these types.
`is_machine` is only used for the repr(simd) type validation check.
@lambda lambda force-pushed the remove-repr-simd-isize-usize-restriction branch from c740493 to 5303c1b Compare March 15, 2019 13:42
@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Mar 15, 2019

📌 Commit 5303c1b has been approved by alexcrichton

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 15, 2019
Centril added a commit to Centril/rust that referenced this pull request Mar 16, 2019
…-restriction, r=alexcrichton

Remove restriction on isize/usize in repr(simd)

As discussed in rust-lang#55078, there's no known reason for this restriction.

It's unlikely that repr(simd) will be stabilized in its current form, but
might as well remove some restrictions on it.

This removes the branch in `is_machine` which returns false for these types.
`is_machine` is only used for the repr(simd) type validation check.
kennytm added a commit to kennytm/rust that referenced this pull request Mar 16, 2019
…-restriction, r=alexcrichton

Remove restriction on isize/usize in repr(simd)

As discussed in rust-lang#55078, there's no known reason for this restriction.

It's unlikely that repr(simd) will be stabilized in its current form, but
might as well remove some restrictions on it.

This removes the branch in `is_machine` which returns false for these types.
`is_machine` is only used for the repr(simd) type validation check.
bors added a commit that referenced this pull request Mar 16, 2019
Rollup of 37 pull requests

Successful merges:

 - #58854 (appveyor: Use VS2017 for all our images)
 - #58855 (std: Spin for a global malloc lock on wasm32)
 - #58873 (Fix "Auto-hide item methods documentation" setting)
 - #58901 (Change `std::fs::copy` to use `copyfile` on MacOS and iOS)
 - #58933 (Move alloc::prelude::* to alloc::prelude::v1, make alloc a subset of std)
 - #58938 (core: ensure VaList passes improper_ctypes lint)
 - #58941 (MIPS: add r6 support)
 - #58949 (SGX target: Expose thread id function in os module)
 - #58959 (Add release notes for PR #56243)
 - #58976 (Default to integrated `rust-lld` linker for UEFI targets)
 - #59009 (Fix SGX implementations of read/write_vectored.)
 - #59025 (Fix generic argument lookup for Self)
 - #59036 (Fix ICE in MIR pretty printing)
 - #59037 (Avoid some common false positives in intra doc link checking)
 - #59072 (we can now skip should_panic tests with the libtest harness)
 - #59079 (add suggestions to invalid macro item error)
 - #59082 (A few improvements to comments in user-facing crates)
 - #59102 (Consistent naming for duration_float methods and additional f32 methods)
 - #59118 (rustc: fix ICE when trait alias has bare Self)
 - #59139 (Unregress using scalar unions in constants.)
 - #59146 (Suggest return lifetime when there's only one named lifetime)
 - #59147 (Make std time tests more robust for platform differences)
 - #59152 (Stabilize Range*::contains.)
 - #59156 ([wg-async-await] Add regression test for #55809.)
 - #59158 (Revert "Don't generate minification variable if minification disabled")
 - #59169 (Add `-Z allow_features=...` flag)
 - #59173 (bootstrap: Default to a sensible llvm-suffix.)
 - #59175 (Don't run test launching `echo` since that doesn't exist on Windows)
 - #59180 (Use try blocks in rustc_codegen_ssa)
 - #59185 (No old chestnuts in iter::repeat docs)
 - #59201 (Remove restriction on isize/usize in repr(simd))
 - #59204 (Output diagnostic information for rustdoc)
 - #59206 (Improved test output)
 - #59208 (Reduce a Code Repetition Related to Bit Operation)
 - #59212 (Add x86_64 musl host to the manifest)
 - #59221 (Option and Result: Add references to documentation of as_ref and as_mut)
 - #59231 (Stabilize Option::copied)
@bors bors merged commit 5303c1b into rust-lang:master Mar 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants