Skip to content

Commit

Permalink
Fix broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
varkor committed Nov 29, 2018
1 parent 32a8dec commit 46ef9f8
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/test/run-pass/binding/empty-types-in-patterns.rs
Expand Up @@ -60,6 +60,7 @@ fn main() {
let x: Result<u32, &!> = Ok(123);
match x {
Ok(y) => y,
Err(_) => unimplemented!(),
};

bar(&[]);
Expand Down
5 changes: 4 additions & 1 deletion src/test/ui/issues/issue-44402.rs
Expand Up @@ -33,7 +33,10 @@ fn test_a() {

fn test_b() {
let x: Option<Bar> = None;
match x { None => () }
match x {
Some(_) => (),
None => ()
}
}

fn main() { }
18 changes: 15 additions & 3 deletions src/test/ui/unreachable/unreachable-loop-patterns.rs
Expand Up @@ -8,14 +8,26 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// compile-fail

#![feature(never_type)]
#![feature(exhaustive_patterns)]

#![allow(unreachable_code)]
#![deny(unreachable_patterns)]

fn main() {
let x: &[!] = &[];
enum Void {}

impl Iterator for Void {
type Item = Void;

for _ in x {}
fn next(&mut self) -> Option<Void> {
None
}
}

fn main() {
for _ in unimplemented!() as Void {}
//~^ ERROR unreachable pattern
}

6 changes: 3 additions & 3 deletions src/test/ui/unreachable/unreachable-loop-patterns.stderr
@@ -1,11 +1,11 @@
error: unreachable pattern
--> $DIR/unreachable-loop-patterns.rs:18:9
--> $DIR/unreachable-loop-patterns.rs:30:9
|
LL | for _ in x {}
LL | for _ in unimplemented!() as Void {}
| ^
|
note: lint level defined here
--> $DIR/unreachable-loop-patterns.rs:13:9
--> $DIR/unreachable-loop-patterns.rs:17:9
|
LL | #![deny(unreachable_patterns)]
| ^^^^^^^^^^^^^^^^^^^^
Expand Down

0 comments on commit 46ef9f8

Please sign in to comment.