File tree Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Original file line number Diff line number Diff line change @@ -217,8 +217,7 @@ impl<'tcx> LateLintPass<'tcx> for DerivableImpls {
217217 if let & Adt ( adt_def, args) = cx. tcx. type_of( item. owner_id) . instantiate_identity( ) . kind( ) ;
218218 if let attrs = cx. tcx. hir( ) . attrs( item. hir_id( ) ) ;
219219 if !attrs. iter( ) . any( |attr| attr. doc_str( ) . is_some( ) ) ;
220- if let child_attrs = cx. tcx. hir( ) . attrs( impl_item_hir) ;
221- if !child_attrs. iter( ) . any( |attr| attr. doc_str( ) . is_some( ) ) ;
220+ if cx. tcx. hir( ) . attrs( impl_item_hir) . is_empty( ) ;
222221
223222 then {
224223 if adt_def. is_struct( ) {
Original file line number Diff line number Diff line change @@ -287,4 +287,17 @@ mod issue10158 {
287287 }
288288}
289289
290+ mod issue11368 {
291+ pub struct A {
292+ a: u32,
293+ }
294+
295+ impl Default for A {
296+ #[track_caller]
297+ fn default() -> Self {
298+ Self { a: 0 }
299+ }
300+ }
301+ }
302+
290303fn main() {}
Original file line number Diff line number Diff line change @@ -323,4 +323,17 @@ mod issue10158 {
323323 }
324324}
325325
326+ mod issue11368 {
327+ pub struct A {
328+ a : u32 ,
329+ }
330+
331+ impl Default for A {
332+ #[ track_caller]
333+ fn default ( ) -> Self {
334+ Self { a : 0 }
335+ }
336+ }
337+ }
338+
326339fn main ( ) { }
You can’t perform that action at this time.
0 commit comments