File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -163,3 +163,12 @@ fn issue15173_original<MsU>(handler: impl FnOnce() -> MsU + Clone + 'static) {
163163 None
164164 } ) as Box < dyn Fn ( i32 ) -> Option < i32 > > ;
165165}
166+
167+ // don't lint if any of the fields has an ambiguous type when used by themselves
168+ fn issue15381 ( ) {
169+ struct DescriptorSet {
170+ slots : Vec < u32 > ,
171+ }
172+
173+ DescriptorSet { slots : Vec :: new ( ) } ;
174+ }
Original file line number Diff line number Diff line change @@ -127,5 +127,11 @@ error: unnecessary operation
127127LL | [42, 55][get_usize()];
128128 | ^^^^^^^^^^^^^^^^^^^^^^ help: statement can be written as: `assert!([42, 55].len() > get_usize());`
129129
130- error: aborting due to 20 previous errors
130+ error: unnecessary operation
131+ --> tests/ui/unnecessary_operation.rs:173:5
132+ |
133+ LL | DescriptorSet { slots: Vec::new() };
134+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `Vec::new();`
135+
136+ error: aborting due to 21 previous errors
131137
You can’t perform that action at this time.
0 commit comments