-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't ICE in might_permit_raw_init if reference is polymorphic
- Loading branch information
1 parent
0b439b1
commit 087a013
Showing
4 changed files
with
50 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
- // MIR for `generic` before InstCombine | ||
+ // MIR for `generic` after InstCombine | ||
|
||
fn generic() -> () { | ||
let mut _0: (); // return place in scope 0 at $DIR/dont_yeet_assert.rs:+0:21: +0:21 | ||
let _1: (); // in scope 0 at $DIR/dont_yeet_assert.rs:+1:5: +1:61 | ||
|
||
bb0: { | ||
StorageLive(_1); // scope 0 at $DIR/dont_yeet_assert.rs:+1:5: +1:61 | ||
- _1 = assert_mem_uninitialized_valid::<&T>() -> bb1; // scope 0 at $DIR/dont_yeet_assert.rs:+1:5: +1:61 | ||
- // mir::Constant | ||
- // + span: $DIR/dont_yeet_assert.rs:10:5: 10:59 | ||
- // + user_ty: UserType(0) | ||
- // + literal: Const { ty: extern "rust-intrinsic" fn() {assert_mem_uninitialized_valid::<&T>}, val: Value(<ZST>) } | ||
+ goto -> bb1; // scope 0 at $DIR/dont_yeet_assert.rs:+1:5: +1:61 | ||
} | ||
|
||
bb1: { | ||
StorageDead(_1); // scope 0 at $DIR/dont_yeet_assert.rs:+1:61: +1:62 | ||
_0 = const (); // scope 0 at $DIR/dont_yeet_assert.rs:+0:21: +2:2 | ||
return; // scope 0 at $DIR/dont_yeet_assert.rs:+2:2: +2:2 | ||
} | ||
} | ||
|
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,11 @@ | ||
// compile-flags: --crate-type=lib | ||
// unit-test: InstCombine | ||
|
||
#![feature(core_intrinsics)] | ||
|
||
// Want to make sure this assertion isn't compiled away in generic code. | ||
|
||
// EMIT_MIR dont_yeet_assert.generic.InstCombine.diff | ||
pub fn generic<T>() { | ||
core::intrinsics::assert_mem_uninitialized_valid::<&T>(); | ||
} |
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,8 @@ | ||
// compile-flags: --crate-type=lib -Zmir-enable-passes=+InstCombine | ||
// build-pass | ||
|
||
#![feature(core_intrinsics)] | ||
|
||
pub fn generic<T>() { | ||
core::intrinsics::assert_mem_uninitialized_valid::<&T>(); | ||
} |