// Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution. // // Licensed under the Apache License, Version 2.0 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. #![feature(alloc)] #![feature(associated_type_defaults)] #![warn(clippy::linkedlist)] #![allow(dead_code, clippy::needless_pass_by_value)] extern crate alloc; use alloc::collections::linked_list::LinkedList; trait Foo { type Baz = LinkedList; fn foo(LinkedList); const BAR : Option>; } // ok, we don’t want to warn for implementations, see #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(); }