forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Safe Transmute: Add test for ICE that has since been fixed
This just makes sure that the ICE in rust-lang#112433 doesn't regress.
- Loading branch information
1 parent
39f42ad
commit 2872ab5
Showing
2 changed files
with
20 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// check-fail | ||
// This was originally causing an ICE in `rustc_transmute::maybe_transmutable` | ||
#![crate_type="lib"] | ||
#[repr(C, packed)] //~ ERROR attribute should be applied to a struct or union | ||
enum V0usize { | ||
V, | ||
} |
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 @@ | ||
error[E0517]: attribute should be applied to a struct or union | ||
--> $DIR/issue-112433.rs:4:11 | ||
| | ||
LL | #[repr(C, packed)] | ||
| ^^^^^^ | ||
LL | / enum V0usize { | ||
LL | | V, | ||
LL | | } | ||
| |_- not a struct or union | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0517`. |