Skip to content

Commit 037c6f8

Browse files
The Miri Cronjob BotRalfJung
authored andcommitted
fmt
1 parent 684f4c9 commit 037c6f8

File tree

5 files changed

+16
-13
lines changed

5 files changed

+16
-13
lines changed

tests/fail/closures/deref-in-pattern.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff 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
}

tests/fail/closures/deref-in-pattern.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: Undefined Behavior: constructing invalid value: encountered a dangling re
44
LL | let _ = || {
55
| _____________^
66
LL | | match x {
7-
LL | | &&_y => {},
7+
LL | | &&_y => {}
88
LL | | }
99
LL | | };
1010
| |_____^ Undefined Behavior occurred here

tests/fail/closures/partial-pattern.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff 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
}

tests/fail/closures/partial-pattern.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: Undefined Behavior: constructing invalid value: encountered a dangling re
44
LL | let _ = || {
55
| _____________^
66
LL | | match x {
7-
LL | | (&_y, _) => {},
7+
LL | | (&_y, _) => {}
88
LL | | }
99
LL | | };
1010
| |_____^ Undefined Behavior occurred here

tests/fail/closures/uninhabited-variant.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
#[repr(C)]
66
#[allow(dead_code)]
77
enum E {
8-
V0, // discriminant: 0
9-
V1, // 1
10-
V2(!), // 2
8+
V0, // discriminant: 0
9+
V1, // 1
10+
V2(!), // 2
1111
}
1212

1313
fn 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(_) => {}

0 commit comments

Comments
 (0)