Treat RETURN_PLACE as a normal Local
Copy its value to the `return_place` upon leaving a call frame
This commit is contained in:
parent
8ce3f840ae
commit
4eaf535d2b
7 changed files with 41 additions and 69 deletions
|
|
@ -13,7 +13,7 @@ LL | / const OUT_OF_BOUNDS_PTR: NonNull<u8> = { unsafe {
|
|||
LL | | let ptr: &[u8; 256] = mem::transmute(&0u8); // &0 gets promoted so it does not dangle
|
||||
LL | | // Use address-of-element for pointer arithmetic. This could wrap around to NULL!
|
||||
LL | | let out_of_bounds_ptr = &ptr[255];
|
||||
| | ^^^^^^^^^ Memory access failed: pointer must be in-bounds at offset 256, but is outside bounds of alloc8 which has size 1
|
||||
| | ^^^^^^^^^ Memory access failed: pointer must be in-bounds at offset 256, but is outside bounds of alloc11 which has size 1
|
||||
LL | | mem::transmute(out_of_bounds_ptr)
|
||||
LL | | } };
|
||||
| |____-
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ LL | / const MUTATING_BEHIND_RAW: () = {
|
|||
LL | | // Test that `MUTABLE_BEHIND_RAW` is actually immutable, by doing this at const time.
|
||||
LL | | unsafe {
|
||||
LL | | *MUTABLE_BEHIND_RAW = 99
|
||||
| | ^^^^^^^^^^^^^^^^^^^^^^^^ writing to alloc1 which is read-only
|
||||
| | ^^^^^^^^^^^^^^^^^^^^^^^^ writing to alloc2 which is read-only
|
||||
LL | | }
|
||||
LL | | };
|
||||
| |__-
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue