-
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.
add_retag: ensure box-to-raw-ptr casts are preserved for Miri
- Loading branch information
Showing
10 changed files
with
91 additions
and
33 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
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
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
17 changes: 17 additions & 0 deletions
17
tests/mir-opt/retag.box_to_raw_mut.SimplifyCfg-pre-optimizations.after.panic-abort.mir
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 @@ | ||
// MIR for `box_to_raw_mut` after SimplifyCfg-pre-optimizations | ||
|
||
fn box_to_raw_mut(_1: &mut Box<i32>) -> *mut i32 { | ||
debug x => _1; | ||
let mut _0: *mut i32; | ||
let mut _2: std::boxed::Box<i32>; | ||
let mut _3: *const i32; | ||
|
||
bb0: { | ||
Retag([fn entry] _1); | ||
_2 = deref_copy (*_1); | ||
_3 = (((_2.0: std::ptr::Unique<i32>).0: std::ptr::NonNull<i32>).0: *const i32); | ||
_0 = &raw mut (*_3); | ||
Retag([raw] _0); | ||
return; | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
tests/mir-opt/retag.box_to_raw_mut.SimplifyCfg-pre-optimizations.after.panic-unwind.mir
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 @@ | ||
// MIR for `box_to_raw_mut` after SimplifyCfg-pre-optimizations | ||
|
||
fn box_to_raw_mut(_1: &mut Box<i32>) -> *mut i32 { | ||
debug x => _1; | ||
let mut _0: *mut i32; | ||
let mut _2: std::boxed::Box<i32>; | ||
let mut _3: *const i32; | ||
|
||
bb0: { | ||
Retag([fn entry] _1); | ||
_2 = deref_copy (*_1); | ||
_3 = (((_2.0: std::ptr::Unique<i32>).0: std::ptr::NonNull<i32>).0: *const i32); | ||
_0 = &raw mut (*_3); | ||
Retag([raw] _0); | ||
return; | ||
} | ||
} |
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