1 // Checks that an unreachable code warning is emitted when an expression is
2 // preceded by an expression with an uninhabited type. Previously, the
3 // variable liveness analysis was "smarter" than the reachability analysis
4 // in this regard, which led to confusing "unused variable" warnings
5 // without an accompanying explanatory "unreachable expression" warning.
9 #![warn(unused_variables,unreachable_code)]
12 fn f() -> Foo {todo!()}
16 //~^ WARNING: unused variable: `x`
18 //~^ WARNING: unreachable expression