I also added `// skip-codegen` to each one, to address potential concerns that this change would otherwise slow down our test suite spending time generating code for files that are really just meant to be checks of compiler diagnostics. (However, I will say: My preference is to not use `// skip-codegen` if one can avoid it. We can use all the testing of how we drive LLVM that we can get...) (Updated post rebase.)
22 lines
723 B
Rust
22 lines
723 B
Rust
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
|
|
// file at the top-level directory of this distribution and at
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
// option. This file may not be copied, modified, or distributed
|
|
// except according to those terms.
|
|
|
|
// Test that an assignment of type ! makes the rest of the block dead code.
|
|
|
|
#![feature(never_type)]
|
|
// compile-pass
|
|
#![warn(unused)]
|
|
|
|
|
|
fn main() {
|
|
let x: ! = panic!("aah"); //~ WARN unused
|
|
drop(x); //~ WARN unreachable
|
|
//~^ WARN unreachable
|
|
}
|