]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/tests/ui/dlist.rs
New upstream version 1.23.0+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / dlist.rs
CommitLineData
ea8adc8c
XL
1#![feature(plugin, alloc)]
2#![feature(associated_type_defaults)]
3
abe05a73 4
ea8adc8c
XL
5#![warn(clippy)]
6#![allow(dead_code, needless_pass_by_value)]
7
8extern crate alloc;
9use alloc::linked_list::LinkedList;
10
11trait Foo {
12 type Baz = LinkedList<u8>;
13 fn foo(LinkedList<u8>);
14 const BAR : Option<LinkedList<u8>>;
15}
16
17// ok, we don’t want to warn for implementations, see #605
18impl Foo for LinkedList<u8> {
19 fn foo(_: LinkedList<u8>) {}
20 const BAR : Option<LinkedList<u8>> = None;
21}
22
23struct Bar;
24impl Bar {
25 fn foo(_: LinkedList<u8>) {}
26}
27
28pub fn test(my_favourite_linked_list: LinkedList<u8>) {
29 println!("{:?}", my_favourite_linked_list)
30}
31
32pub fn test_ret() -> Option<LinkedList<u8>> {
33 unimplemented!();
34}
35
36pub fn test_local_not_linted() {
37 let _: LinkedList<u8>;
38}
39
40fn main(){
41 test(LinkedList::new());
42 test_local_not_linted();
43}