Skip to content

Commit

Permalink
Safe Transmute: Add test for ICE that has since been fixed
Browse files Browse the repository at this point in the history
This just makes sure that the ICE in rust-lang#112433 doesn't regress.
  • Loading branch information
bryangarza committed Jul 19, 2023
1 parent 39f42ad commit 2872ab5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/ui/transmutability/issue-112433.rs
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,
}
13 changes: 13 additions & 0 deletions tests/ui/transmutability/issue-112433.stderr
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`.

0 comments on commit 2872ab5

Please sign in to comment.