-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make
#[repr(Rust)]
and #[repr(C)]
incompatible with one another
- Loading branch information
Showing
4 changed files
with
48 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,13 @@ | ||
#[repr(C, Rust)] //~ ERROR conflicting representation hints | ||
struct S { | ||
a: i32, | ||
} | ||
|
||
|
||
#[repr(Rust)] //~ ERROR conflicting representation hints | ||
#[repr(C)] | ||
struct T { | ||
a: i32, | ||
} | ||
|
||
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,17 @@ | ||
error[E0566]: conflicting representation hints | ||
--> $DIR/repr-c-explicit-rust.rs:1:8 | ||
| | ||
LL | #[repr(C, Rust)] | ||
| ^ ^^^^ | ||
|
||
error[E0566]: conflicting representation hints | ||
--> $DIR/repr-c-explicit-rust.rs:7:8 | ||
| | ||
LL | #[repr(Rust)] | ||
| ^^^^ | ||
LL | #[repr(C)] | ||
| ^ | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0566`. |