1 #![feature(tool_lints)]
3 #![allow(unused, dead_code, clippy::needless_lifetimes, clippy::needless_pass_by_value, clippy::trivially_copy_pass_by_ref)]
4 #![warn(clippy::extra_unused_lifetimes)]
11 fn used_lt<'a>(x: &'a u8) {
16 fn unused_lt<'a>(x: u8) {
20 fn unused_lt_transitive<'a, 'b: 'a>(x: &'b u8) {
21 // 'a is useless here since it's not directly bound
24 fn lt_return<'a, 'b: 'a>(x: &'b u8) -> &'a u8 {
28 fn lt_return_only<'a>() -> &'a u8 {
32 fn unused_lt_blergh<'a>(x: Option<Box<Send+'a>>) {
38 fn x(&self, a: &'a u8);
41 impl<'a> Foo<'a> for u8 {
42 fn x(&self, a: &'a u8) {
53 // test for #489 (used lifetimes in bounds)
54 pub fn parse<'a, I: Iterator<Item=&'a str>>(_it: &mut I) {
57 pub fn parse2<'a, I>(_it: &mut I) where I: Iterator<Item=&'a str>{
64 fn self_ref_with_lifetime<'a>(&'a self) {}
65 fn explicit_self_with_lifetime<'a>(self: &'a Self) {}