]> git.lizzy.rs Git - rust.git/blob - tests/ui/dlist.rs
Adapt the *.stderr files of the ui-tests to the tool_lints
[rust.git] / tests / ui / dlist.rs
1 #![feature(tool_lints)]
2
3 #![feature(alloc)]
4 #![feature(associated_type_defaults)]
5
6
7 #![warn(clippy::linkedlist)]
8 #![allow(dead_code, clippy::needless_pass_by_value)]
9
10 extern crate alloc;
11 use alloc::collections::linked_list::LinkedList;
12
13 trait Foo {
14     type Baz = LinkedList<u8>;
15     fn foo(LinkedList<u8>);
16     const BAR : Option<LinkedList<u8>>;
17 }
18
19 // ok, we don’t want to warn for implementations, see #605
20 impl Foo for LinkedList<u8> {
21     fn foo(_: LinkedList<u8>) {}
22     const BAR : Option<LinkedList<u8>> = None;
23 }
24
25 struct Bar;
26 impl Bar {
27     fn foo(_: LinkedList<u8>) {}
28 }
29
30 pub fn test(my_favourite_linked_list: LinkedList<u8>) {
31     println!("{:?}", my_favourite_linked_list)
32 }
33
34 pub fn test_ret() -> Option<LinkedList<u8>> {
35     unimplemented!();
36 }
37
38 pub fn test_local_not_linted() {
39     let _: LinkedList<u8>;
40 }
41
42 fn main(){
43     test(LinkedList::new());
44     test_local_not_linted();
45 }