#![allow(unused, clippy::needless_lifetimes)] #![warn(clippy::extra_unused_type_parameters)] fn unused_ty(x: u8) { unimplemented!() } fn unused_multi(x: u8) { unimplemented!() } fn unused_with_lt<'a, T>(x: &'a u8) { unimplemented!() } fn used_ty(x: T, y: u8) {} fn used_ref<'a, T>(x: &'a T) {} fn used_ret(x: u8) -> T { T::default() } fn unused_bounded(x: U) { unimplemented!(); } fn unused_where_clause(x: U) where T: Default, { unimplemented!(); } fn some_unused, E>(b: B, c: C) { unimplemented!(); } fn used_opaque(iter: impl Iterator) -> usize { iter.count() } fn used_ret_opaque() -> impl Iterator { std::iter::empty() } fn used_vec_box(x: Vec>) {} fn used_body() -> String { T::default().to_string() } fn used_closure() -> impl Fn() { || println!("{}", T::default().to_string()) } struct S; impl S { fn unused_ty_impl(&self) { unimplemented!() } } // Don't lint on trait methods trait Foo { fn bar(&self); } impl Foo for S { fn bar(&self) {} } fn skip_index(iter: Iter, index: usize) -> impl Iterator where Iter: Iterator, { iter.enumerate() .filter_map(move |(i, a)| if i == index { None } else { Some(a) }) } fn unused_opaque(dummy: impl Default) { unimplemented!() } mod unexported_trait_bounds { mod private { pub trait Private {} } fn priv_trait_bound() { unimplemented!(); } fn unused_with_priv_trait_bound() { unimplemented!(); } } mod issue10319 { fn assert_send() {} fn assert_send_where() where T: Send, { } } fn main() {}