]> git.proxmox.com Git - rustc.git/blame - src/test/ui/lint/dead-code/issue-85071-2.rs
New upstream version 1.64.0+dfsg1
[rustc.git] / src / test / ui / lint / dead-code / issue-85071-2.rs
CommitLineData
94222f64
XL
1// A slight variation of issue-85071.rs. Here, a method is called instead
2// of a function, and the warning is about an unreachable definition
3// instead of an unreachable expression.
4
5// check-pass
6
7#![warn(unused_variables,unreachable_code)]
8
9enum Foo {}
10
11struct S;
12impl S {
13 fn f(&self) -> Foo {todo!()}
14}
15
16fn main() {
17 let s = S;
18 let x = s.f();
19 //~^ WARNING: unused variable: `x`
20 let _y = x;
21 //~^ WARNING: unreachable definition
22}