2019-07-03 06:30:28 +09:00
|
|
|
// build-pass (FIXME(62277): could be check-pass?)
|
2018-11-03 19:18:24 +00:00
|
|
|
|
2018-11-06 19:38:01 +00:00
|
|
|
#![deny(unused_variables)]
|
2018-11-03 19:18:24 +00: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 19:38:01 +00:00
|
|
|
let a = 42;
|
2018-11-03 19:18:24 +00:00
|
|
|
foo::give_foo();
|
2018-11-06 19:38:01 +00:00
|
|
|
println!("Hello, {}", a); // ok: we can't tell that this code is dead
|
2018-11-03 19:18:24 +00:00
|
|
|
}
|