Skip to content

Commit

Permalink
Make storage-live.rs robust against rustc internal changes.
Browse files Browse the repository at this point in the history
Currently it can be made to fail by rearranging code within
`compiler/rustc_mir_transform/src/lint.rs`.
  • Loading branch information
nnethercote committed Jun 11, 2024
1 parent b5b1356 commit 1a60597
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions tests/ui/mir/lint/storage-live.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
//@ normalize-stderr-test "note: .*\n\n" -> ""
//@ normalize-stderr-test "thread 'rustc' panicked.*\n" -> ""
//@ normalize-stderr-test "storage_live\[....\]" -> "storage_live[HASH]"
//@ normalize-stderr-test "(delayed at [^:]+):\d+:\d+ - " -> "$1:LL:CC - "
//@ rustc-env:RUST_BACKTRACE=0

#![feature(custom_mir, core_intrinsics)]
Expand Down
6 changes: 3 additions & 3 deletions tests/ui/mir/lint/storage-live.stderr
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
error: internal compiler error: broken MIR in Item(DefId(0:8 ~ storage_live[HASH]::multiple_storage)) (after pass CheckPackedRef) at bb0[1]:
StorageLive(_1) which already has storage here
--> $DIR/storage-live.rs:22:13
--> $DIR/storage-live.rs:23:13
|
LL | StorageLive(a);
| ^^^^^^^^^^^^^^
|
note: delayed at compiler/rustc_mir_transform/src/lint.rs:97:26 - disabled backtrace
--> $DIR/storage-live.rs:22:13
note: delayed at compiler/rustc_mir_transform/src/lint.rs:LL:CC - disabled backtrace
--> $DIR/storage-live.rs:23:13
|
LL | StorageLive(a);
| ^^^^^^^^^^^^^^
Expand Down

0 comments on commit 1a60597

Please sign in to comment.