#![feature(associated_type_defaults)] #![warn(clippy::linkedlist)] #![allow(dead_code, clippy::needless_pass_by_value)] extern crate alloc; use alloc::collections::linked_list::LinkedList; const C: LinkedList = LinkedList::new(); static S: LinkedList = LinkedList::new(); trait Foo { type Baz = LinkedList; fn foo(_: LinkedList); const BAR: Option>; } // Ok, we don’t want to warn for implementations; see issue #605. impl Foo for LinkedList { fn foo(_: LinkedList) {} const BAR: Option> = None; } struct Bar; impl Bar { fn foo(_: LinkedList) {} } pub fn test(my_favourite_linked_list: LinkedList) { println!("{:?}", my_favourite_linked_list) } pub fn test_ret() -> Option> { unimplemented!(); } pub fn test_local_not_linted() { let _: LinkedList; } fn main() { test(LinkedList::new()); test_local_not_linted(); }