2019-07-02 16:30:28 -05:00
|
|
|
// build-pass (FIXME(62277): could be check-pass?)
|
2018-11-03 14:18:24 -05:00
|
|
|
|
2018-11-06 13:38:01 -06:00
|
|
|
#![deny(unused_variables)]
|
2018-11-03 14:18:24 -05:00
|
|
|
|
|
|
|
mod foo {
|
|
|
|
enum Bar {}
|
|
|
|
|
|
|
|
#[allow(dead_code)]
|
|
|
|
pub struct Foo {
|
|
|
|
value: Bar, // "privately" uninhabited
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn give_foo() -> Foo { panic!() }
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2018-11-06 13:38:01 -06:00
|
|
|
let a = 42;
|
2018-11-03 14:18:24 -05:00
|
|
|
foo::give_foo();
|
2018-11-06 13:38:01 -06:00
|
|
|
println!("Hello, {}", a); // ok: we can't tell that this code is dead
|
2018-11-03 14:18:24 -05:00
|
|
|
}
|