1 // Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution.
4 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
5 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
6 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
7 // option. This file may not be copied, modified, or distributed
8 // except according to those terms.
11 #![feature(tool_lints)]
14 #![feature(associated_type_defaults)]
17 #![warn(clippy::linkedlist)]
18 #![allow(dead_code, clippy::needless_pass_by_value)]
21 use alloc::collections::linked_list::LinkedList;
24 type Baz = LinkedList<u8>;
25 fn foo(LinkedList<u8>);
26 const BAR : Option<LinkedList<u8>>;
29 // ok, we don’t want to warn for implementations, see #605
30 impl Foo for LinkedList<u8> {
31 fn foo(_: LinkedList<u8>) {}
32 const BAR : Option<LinkedList<u8>> = None;
37 fn foo(_: LinkedList<u8>) {}
40 pub fn test(my_favourite_linked_list: LinkedList<u8>) {
41 println!("{:?}", my_favourite_linked_list)
44 pub fn test_ret() -> Option<LinkedList<u8>> {
48 pub fn test_local_not_linted() {
49 let _: LinkedList<u8>;
53 test(LinkedList::new());
54 test_local_not_linted();