]>
Commit | Line | Data |
---|---|---|
f20569fa XL |
1 | // run-rustfix |
2 | ||
3 | #![allow(dead_code)] | |
4 | ||
5 | struct SizedStruct(i32); | |
6 | struct UnsizedStruct([i32]); | |
7 | struct BigStruct([i32; 10000]); | |
8 | ||
9 | /// The following should trigger the lint | |
10 | mod should_trigger { | |
11 | use super::SizedStruct; | |
12 | ||
13 | struct StructWithVecBox { | |
14 | sized_type: Vec<SizedStruct>, | |
15 | } | |
16 | ||
17 | struct A(Vec<SizedStruct>); | |
18 | struct B(Vec<Vec<u32>>); | |
19 | } | |
20 | ||
21 | /// The following should not trigger the lint | |
22 | mod should_not_trigger { | |
23 | use super::{BigStruct, UnsizedStruct}; | |
24 | ||
25 | struct C(Vec<Box<UnsizedStruct>>); | |
26 | struct D(Vec<Box<BigStruct>>); | |
27 | ||
28 | struct StructWithVecBoxButItsUnsized { | |
29 | unsized_type: Vec<Box<UnsizedStruct>>, | |
30 | } | |
31 | ||
32 | struct TraitVec<T: ?Sized> { | |
33 | // Regression test for #3720. This was causing an ICE. | |
34 | inner: Vec<Box<T>>, | |
35 | } | |
36 | } | |
37 | ||
38 | mod inner_mod { | |
39 | mod inner { | |
40 | pub struct S; | |
41 | } | |
42 | ||
43 | mod inner2 { | |
44 | use super::inner::S; | |
45 | ||
46 | pub fn f() -> Vec<S> { | |
47 | vec![] | |
48 | } | |
49 | } | |
50 | } | |
51 | ||
52 | fn main() {} |