]> git.lizzy.rs Git - rust.git/blob - tests/ui/single-use-lifetime/zero-uses-in-fn.fixed
Rollup merge of #106897 - estebank:issue-99430, r=davidtwco
[rust.git] / tests / ui / single-use-lifetime / zero-uses-in-fn.fixed
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() {}
9 //~^ ERROR lifetime parameter `'a` never used
10 //~| HELP elide the unused lifetime
11
12 fn october<'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>(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() {}