File tree Expand file tree Collapse file tree 3 files changed +41
-1
lines changed Expand file tree Collapse file tree 3 files changed +41
-1
lines changed Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ impl<'tcx> LateLintPass<'tcx> for NewWithoutDefault {
94
94
return ;
95
95
}
96
96
if sig. decl . inputs . is_empty ( )
97
- && cx. effective_visibilities . is_reachable ( impl_item. owner_id . def_id )
97
+ && cx. effective_visibilities . is_exported ( impl_item. owner_id . def_id )
98
98
&& let self_ty = cx. tcx . type_of ( item. owner_id ) . instantiate_identity ( )
99
99
&& self_ty == return_ty ( cx, impl_item. owner_id )
100
100
&& let Some ( default_trait_id) = cx. tcx . get_diagnostic_item ( sym:: Default )
Original file line number Diff line number Diff line change @@ -322,3 +322,23 @@ where
322
322
Self { _kv: None }
323
323
}
324
324
}
325
+
326
+ mod issue15778 {
327
+ pub struct Foo(Vec<i32>);
328
+
329
+ impl Foo {
330
+ pub fn new() -> Self {
331
+ Self(Vec::new())
332
+ }
333
+ }
334
+
335
+ impl<'a> IntoIterator for &'a Foo {
336
+ type Item = &'a i32;
337
+
338
+ type IntoIter = std::slice::Iter<'a, i32>;
339
+
340
+ fn into_iter(self) -> Self::IntoIter {
341
+ self.0.as_slice().iter()
342
+ }
343
+ }
344
+ }
Original file line number Diff line number Diff line change @@ -265,3 +265,23 @@ where
265
265
Self { _kv : None }
266
266
}
267
267
}
268
+
269
+ mod issue15778 {
270
+ pub struct Foo ( Vec < i32 > ) ;
271
+
272
+ impl Foo {
273
+ pub fn new ( ) -> Self {
274
+ Self ( Vec :: new ( ) )
275
+ }
276
+ }
277
+
278
+ impl < ' a > IntoIterator for & ' a Foo {
279
+ type Item = & ' a i32 ;
280
+
281
+ type IntoIter = std:: slice:: Iter < ' a , i32 > ;
282
+
283
+ fn into_iter ( self ) -> Self :: IntoIter {
284
+ self . 0 . as_slice ( ) . iter ( )
285
+ }
286
+ }
287
+ }
You can’t perform that action at this time.
0 commit comments