forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#116829 - fmease:rust-aint-c, r=compiler-errors Make `#[repr(Rust)]` incompatible with other (non-modifier) representation hints like `C` and `simd` Read more about this change here: rust-lang#116829 (comment). Fixes [after backport] rust-lang#116825.
- Loading branch information
Showing
4 changed files
with
80 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#[repr(C, Rust)] //~ ERROR conflicting representation hints | ||
struct S { | ||
a: i32, | ||
} | ||
|
||
|
||
#[repr(Rust)] //~ ERROR conflicting representation hints | ||
#[repr(C)] | ||
struct T { | ||
a: i32, | ||
} | ||
|
||
#[repr(Rust, u64)] //~ ERROR conflicting representation hints | ||
enum U { | ||
V, | ||
} | ||
|
||
#[repr(Rust, simd)] | ||
//~^ ERROR conflicting representation hints | ||
//~| ERROR SIMD types are experimental and possibly buggy | ||
struct F32x4(f32, f32, f32, f32); | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
error[E0658]: SIMD types are experimental and possibly buggy | ||
--> $DIR/explicit-rust-repr-conflicts.rs:18:1 | ||
| | ||
LL | #[repr(Rust, simd)] | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #27731 <https://github.com/rust-lang/rust/issues/27731> for more information | ||
= help: add `#![feature(repr_simd)]` to the crate attributes to enable | ||
|
||
error[E0566]: conflicting representation hints | ||
--> $DIR/explicit-rust-repr-conflicts.rs:1:8 | ||
| | ||
LL | #[repr(C, Rust)] | ||
| ^ ^^^^ | ||
|
||
error[E0566]: conflicting representation hints | ||
--> $DIR/explicit-rust-repr-conflicts.rs:7:8 | ||
| | ||
LL | #[repr(Rust)] | ||
| ^^^^ | ||
LL | #[repr(C)] | ||
| ^ | ||
|
||
error[E0566]: conflicting representation hints | ||
--> $DIR/explicit-rust-repr-conflicts.rs:13:8 | ||
| | ||
LL | #[repr(Rust, u64)] | ||
| ^^^^ ^^^ | ||
|
||
error[E0566]: conflicting representation hints | ||
--> $DIR/explicit-rust-repr-conflicts.rs:18:8 | ||
| | ||
LL | #[repr(Rust, simd)] | ||
| ^^^^ ^^^^ | ||
|
||
error: aborting due to 5 previous errors | ||
|
||
Some errors have detailed explanations: E0566, E0658. | ||
For more information about an error, try `rustc --explain E0566`. |