Skip to content

Commit 46ef9f8

Browse files
committed
Fix broken tests
1 parent 32a8dec commit 46ef9f8

File tree

4 files changed

+23
-7
lines changed

4 files changed

+23
-7
lines changed

src/test/run-pass/binding/empty-types-in-patterns.rs

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ fn main() {
6060
let x: Result<u32, &!> = Ok(123);
6161
match x {
6262
Ok(y) => y,
63+
Err(_) => unimplemented!(),
6364
};
6465

6566
bar(&[]);

src/test/ui/issues/issue-44402.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ fn test_a() {
3333

3434
fn test_b() {
3535
let x: Option<Bar> = None;
36-
match x { None => () }
36+
match x {
37+
Some(_) => (),
38+
None => ()
39+
}
3740
}
3841

3942
fn main() { }

src/test/ui/unreachable/unreachable-loop-patterns.rs

+15-3
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,26 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// compile-fail
12+
1113
#![feature(never_type)]
1214
#![feature(exhaustive_patterns)]
15+
16+
#![allow(unreachable_code)]
1317
#![deny(unreachable_patterns)]
1418

15-
fn main() {
16-
let x: &[!] = &[];
19+
enum Void {}
20+
21+
impl Iterator for Void {
22+
type Item = Void;
1723

18-
for _ in x {}
24+
fn next(&mut self) -> Option<Void> {
25+
None
26+
}
27+
}
28+
29+
fn main() {
30+
for _ in unimplemented!() as Void {}
1931
//~^ ERROR unreachable pattern
2032
}
2133

src/test/ui/unreachable/unreachable-loop-patterns.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error: unreachable pattern
2-
--> $DIR/unreachable-loop-patterns.rs:18:9
2+
--> $DIR/unreachable-loop-patterns.rs:30:9
33
|
4-
LL | for _ in x {}
4+
LL | for _ in unimplemented!() as Void {}
55
| ^
66
|
77
note: lint level defined here
8-
--> $DIR/unreachable-loop-patterns.rs:13:9
8+
--> $DIR/unreachable-loop-patterns.rs:17:9
99
|
1010
LL | #![deny(unreachable_patterns)]
1111
| ^^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)