Skip to content

Commit 38c3e0d

Browse files
committed
Fix unreachable-try-patterns
1 parent 3daf17c commit 38c3e0d

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/librustc_codegen_llvm/declare.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
use llvm::{self, ValueRef};
2424
use llvm::AttributePlace::Function;
2525
use rustc::ty::{self, Ty};
26-
use rustc::ty::layout::{self, LayoutOf};
2726
use rustc::session::config::Sanitizer;
2827
use rustc_target::spec::PanicStrategy;
2928
use abi::{Abi, FnType, FnTypeExt};

src/test/compile-fail/unreachable-try-pattern.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ enum Void {}
1717

1818
impl From<Void> for i32 {
1919
fn from(v: Void) -> i32 {
20+
//~^ WARN unreachable expression
2021
match v {}
22+
//~^ WARN unreachable expression
2123
}
2224
}
2325

@@ -39,6 +41,7 @@ fn qux(x: Result<u32, Void>) -> Result<u32, i32> {
3941
fn vom(x: Result<u32, Void>) -> Result<u32, i32> {
4042
let y = (match x { Ok(n) => Ok(n), Err(e) => Err(e) })?;
4143
//~^ WARN unreachable pattern
44+
//~| WARN unreachable expression
4245
Ok(y)
4346
}
4447

0 commit comments

Comments
 (0)