This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +20
-4
lines changed Expand file tree Collapse file tree 4 files changed +20
-4
lines changed Original file line number Diff line number Diff line change 1- // Make sure that we don't actually insert a check for `addr_of!`.
1+ // Make sure that we don't insert a check for `addr_of!`.
22//@ run-pass
33//@ compile-flags: -C debug-assertions
44
Original file line number Diff line number Diff line change 1- // Make sure that we don't actually insert a check for places that do not read.
1+ // Make sure that we don't insert a check for places that do not read.
22//@ run-pass
33//@ compile-flags: -C debug-assertions
44
Original file line number Diff line number Diff line change 1+ // Make sure that we don't insert a check for references instead of pointers.
2+ //@ run-pass
3+ //@ compile-flags: -C debug-assertions
4+
5+ struct Null {
6+ a : u32 ,
7+ }
8+
9+ fn main ( ) {
10+ let val: u32 = 42 ;
11+ let val_ref: & u32 = & val;
12+ let _access1: & u32 = & * val_ref;
13+
14+ let val = Null { a : 43 } ;
15+ let _access2: & u32 = & val. a ;
16+ }
Original file line number Diff line number Diff line change 1- // Make sure that we don't actually insert a check for zero-sized reads or writes
2- // to null, because they are actually allowed.
1+ // Make sure that we don't insert a check for zero-sized reads or writes to
2+ // null, because they are allowed.
33//@ run-pass
44//@ compile-flags: -C debug-assertions
55
You can’t perform that action at this time.
0 commit comments