-
Notifications
You must be signed in to change notification settings - Fork 360
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #1614 - RalfJung:raw-retag, r=RalfJung
Stacked Borrows: test raw-ref-to-field with raw ptr tracking Adds a test for rust-lang/rust#78597 (blocked on that landing first)
- Loading branch information
Showing
6 changed files
with
43 additions
and
14 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 |
---|---|---|
@@ -1 +1 @@ | ||
a53fb30e3bf2655b0563da6d561c23cda5f3ec11 | ||
5cdf5b882da9e8b7c73b5cadeb7745cb68f6ff63 |
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,13 @@ | ||
fn main() { | ||
ref_raw_int_raw(); | ||
} | ||
|
||
// Just to make sure that casting a ref to raw, to int and back to raw | ||
// and only then using it works. This rules out ideas like "do escape-to-raw lazily"; | ||
// after casting to int and back, we lost the tag that could have let us do that. | ||
fn ref_raw_int_raw() { | ||
let mut x = 3; | ||
let xref = &mut x; | ||
let xraw = xref as *mut i32 as usize as *mut i32; | ||
assert_eq!(unsafe { *xraw }, 3); | ||
} |
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