]> git.lizzy.rs Git - rust.git/blob - src/test/ui/single-use-lifetime/zero-uses-in-fn.rs
Do not complain about missing `fn main()` in some cases
[rust.git] / src / test / ui / single-use-lifetime / zero-uses-in-fn.rs
1 // run-rustfix
2
3 // Test that we DO warn when lifetime name is not used at all.
4
5 #![deny(unused_lifetimes)]
6 #![allow(dead_code, unused_variables)]
7
8 fn september<'a>() {}
9 //~^ ERROR lifetime parameter `'a` never used
10 //~| HELP elide the unused lifetime
11
12 fn october<'a, 'b, T>(s: &'b T) -> &'b T {
13     //~^ ERROR lifetime parameter `'a` never used
14     //~| HELP elide the unused lifetime
15     s
16 }
17
18 fn november<'a, 'b>(s: &'a str) -> (&'a str) {
19     //~^ ERROR lifetime parameter `'b` never used
20     //~| HELP elide the unused lifetime
21     s
22 }
23
24 fn main() {}