]> git.lizzy.rs Git - rust.git/blob - tests/ui/complex_types.rs
Rename lint to needless_take_by_value
[rust.git] / tests / ui / complex_types.rs
1 #![feature(plugin)]
2 #![plugin(clippy)]
3 #![deny(clippy)]
4 #![allow(unused, needless_pass_by_value)]
5 #![feature(associated_consts, associated_type_defaults)]
6
7 type Alias = Vec<Vec<Box<(u32, u32, u32, u32)>>>; // no warning here
8
9 const CST: (u32, (u32, (u32, (u32, u32)))) = (0, (0, (0, (0, 0))));
10 static ST: (u32, (u32, (u32, (u32, u32)))) = (0, (0, (0, (0, 0))));
11
12 struct S {
13     f: Vec<Vec<Box<(u32, u32, u32, u32)>>>,
14 }
15
16 struct TS(Vec<Vec<Box<(u32, u32, u32, u32)>>>);
17
18 enum E {
19     Tuple(Vec<Vec<Box<(u32, u32, u32, u32)>>>),
20     Struct { f: Vec<Vec<Box<(u32, u32, u32, u32)>>> },
21 }
22
23 impl S {
24     const A: (u32, (u32, (u32, (u32, u32)))) = (0, (0, (0, (0, 0))));
25     fn impl_method(&self, p: Vec<Vec<Box<(u32, u32, u32, u32)>>>) { }
26 }
27
28 trait T {
29     const A: Vec<Vec<Box<(u32, u32, u32, u32)>>>;
30     type B = Vec<Vec<Box<(u32, u32, u32, u32)>>>;
31     fn method(&self, p: Vec<Vec<Box<(u32, u32, u32, u32)>>>);
32     fn def_method(&self, p: Vec<Vec<Box<(u32, u32, u32, u32)>>>) { }
33 }
34
35 fn test1() -> Vec<Vec<Box<(u32, u32, u32, u32)>>> { vec![] }
36
37 fn test2(_x: Vec<Vec<Box<(u32, u32, u32, u32)>>>) { }
38
39 fn test3() {
40     let _y: Vec<Vec<Box<(u32, u32, u32, u32)>>> = vec![];
41 }
42
43 fn main() {
44 }