2018-09-29 23:25:41 -05:00
|
|
|
// run-rustfix
|
|
|
|
|
|
|
|
// Test that we DO warn when lifetime name is not used at all.
|
|
|
|
|
|
|
|
#![deny(unused_lifetimes)]
|
|
|
|
#![allow(dead_code, unused_variables)]
|
|
|
|
|
|
|
|
fn september() {}
|
|
|
|
//~^ ERROR lifetime parameter `'a` never used
|
2018-10-28 01:40:56 -05:00
|
|
|
//~| HELP elide the unused lifetime
|
2018-09-29 23:25:41 -05:00
|
|
|
|
|
|
|
fn october<'b, T>(s: &'b T) -> &'b T {
|
|
|
|
//~^ ERROR lifetime parameter `'a` never used
|
2018-10-28 01:40:56 -05:00
|
|
|
//~| HELP elide the unused lifetime
|
2018-09-29 23:25:41 -05:00
|
|
|
s
|
|
|
|
}
|
|
|
|
|
2019-10-04 00:56:57 -05:00
|
|
|
fn november<'a>(s: &'a str) -> &'a str {
|
2018-09-29 23:25:41 -05:00
|
|
|
//~^ ERROR lifetime parameter `'b` never used
|
2018-10-28 01:40:56 -05:00
|
|
|
//~| HELP elide the unused lifetime
|
2018-09-29 23:25:41 -05:00
|
|
|
s
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|