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(associated_type_defaults)]
12 #![warn(clippy::linkedlist)]
13 #![allow(dead_code, clippy::needless_pass_by_value)]
16 use alloc::collections::linked_list::LinkedList;
19 type Baz = LinkedList<u8>;
20 fn foo(LinkedList<u8>);
21 const BAR: Option<LinkedList<u8>>;
24 // ok, we don’t want to warn for implementations, see #605
25 impl Foo for LinkedList<u8> {
26 fn foo(_: LinkedList<u8>) {}
27 const BAR: Option<LinkedList<u8>> = None;
32 fn foo(_: LinkedList<u8>) {}
35 pub fn test(my_favourite_linked_list: LinkedList<u8>) {
36 println!("{:?}", my_favourite_linked_list)
39 pub fn test_ret() -> Option<LinkedList<u8>> {
43 pub fn test_local_not_linted() {
44 let _: LinkedList<u8>;
48 test(LinkedList::new());
49 test_local_not_linted();