1 #![feature(associated_type_defaults)]
2 #![warn(clippy::linkedlist)]
3 #![allow(unused, dead_code, clippy::needless_pass_by_value)]
6 use alloc::collections::linked_list::LinkedList;
8 const C: LinkedList<i32> = LinkedList::new();
9 static S: LinkedList<i32> = LinkedList::new();
12 type Baz = LinkedList<u8>;
13 fn foo(_: LinkedList<u8>);
14 const BAR: Option<LinkedList<u8>>;
17 // Ok, we don’t want to warn for implementations; see issue #605.
18 impl Foo for LinkedList<u8> {
19 fn foo(_: LinkedList<u8>) {}
20 const BAR: Option<LinkedList<u8>> = None;
24 priv_linked_list_field: LinkedList<u8>,
25 pub pub_linked_list_field: LinkedList<u8>,
28 fn foo(_: LinkedList<u8>) {}
31 // All of these test should be trigger the lint because they are not
32 // part of the public api
33 fn test(my_favorite_linked_list: LinkedList<u8>) {}
34 fn test_ret() -> Option<LinkedList<u8>> {
37 fn test_local_not_linted() {
38 let _: LinkedList<u8>;
41 // All of these test should be allowed because they are part of the
42 // public api and `avoid_breaking_exported_api` is `false` by default.
43 pub fn pub_test(the_most_awesome_linked_list: LinkedList<u8>) {}
44 pub fn pub_test_ret() -> Option<LinkedList<u8>> {