File tree Expand file tree Collapse file tree 5 files changed +16
-13
lines changed
Expand file tree Collapse file tree 5 files changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -9,12 +9,13 @@ fn main() {
99 // the inner reference is dangling
1010 let x: & & u32 = unsafe {
1111 let x: u32 = 42 ;
12- & & * & raw const x
12+ & & * & raw const x
1313 } ;
1414
15- let _ = || { //~ ERROR: encountered a dangling reference
15+ //~v ERROR: encountered a dangling reference
16+ let _ = || {
1617 match x {
17- & & _y => { } ,
18+ & & _y => { }
1819 }
1920 } ;
2021}
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ error: Undefined Behavior: constructing invalid value: encountered a dangling re
44LL | let _ = || {
55 | _____________^
66LL | | match x {
7- LL | | &&_y => {},
7+ LL | | &&_y => {}
88LL | | }
99LL | | };
1010 | |_____^ Undefined Behavior occurred here
Original file line number Diff line number Diff line change @@ -15,14 +15,15 @@ fn main() {
1515 let x: & ( & u32 , & u32 ) = unsafe {
1616 let a = 21 ;
1717 let b = 37 ;
18- let ra = & * & raw const a;
19- let rb = & * & raw const b;
18+ let ra = & * & raw const a;
19+ let rb = & * & raw const b;
2020 & ( ra, rb)
2121 } ;
2222
23- let _ = || { //~ ERROR: encountered a dangling reference
23+ //~v ERROR: encountered a dangling reference
24+ let _ = || {
2425 match x {
25- ( & _y, _) => { } ,
26+ ( & _y, _) => { }
2627 }
2728 } ;
2829}
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ error: Undefined Behavior: constructing invalid value: encountered a dangling re
44LL | let _ = || {
55 | _____________^
66LL | | match x {
7- LL | | (&_y, _) => {},
7+ LL | | (&_y, _) => {}
88LL | | }
99LL | | };
1010 | |_____^ Undefined Behavior occurred here
Original file line number Diff line number Diff line change 55#[ repr( C ) ]
66#[ allow( dead_code) ]
77enum E {
8- V0 , // discriminant: 0
9- V1 , // 1
10- V2 ( !) , // 2
8+ V0 , // discriminant: 0
9+ V1 , // 1
10+ V2 ( !) , // 2
1111}
1212
1313fn main ( ) {
@@ -20,7 +20,8 @@ fn main() {
2020 // After rust-lang/rust#138961, constructing the closure performs a reborrow of r.
2121 // Nevertheless, the discriminant is only actually inspected when the closure
2222 // is called.
23- match r { //~ ERROR: read discriminant of an uninhabited enum variant
23+ match r {
24+ //~^ ERROR: read discriminant of an uninhabited enum variant
2425 E :: V0 => { }
2526 E :: V1 => { }
2627 E :: V2 ( _) => { }
You can’t perform that action at this time.
0 commit comments