]>
Commit | Line | Data |
---|---|---|
416331ca | 1 | // build-pass (FIXME(62277): could be check-pass?) |
0731742a XL |
2 | |
3 | #![deny(unused_variables)] | |
4 | ||
5 | mod foo { | |
6 | enum Bar {} | |
7 | ||
8 | #[allow(dead_code)] | |
9 | pub struct Foo { | |
10 | value: Bar, // "privately" uninhabited | |
11 | } | |
12 | ||
13 | pub fn give_foo() -> Foo { panic!() } | |
14 | } | |
15 | ||
16 | fn main() { | |
17 | let a = 42; | |
18 | foo::give_foo(); | |
19 | println!("Hello, {}", a); // ok: we can't tell that this code is dead | |
20 | } |