File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
clippy_utils/src/ast_utils Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -232,6 +232,7 @@ impl<'tcx> LateLintPass<'tcx> for DerivableImpls {
232232 of_trait : Some ( of_trait) ,
233233 items : [ child] ,
234234 self_ty,
235+ constness,
235236 ..
236237 } ) = item. kind
237238 && !cx. tcx . is_automatically_derived ( item. owner_id . to_def_id ( ) )
@@ -247,7 +248,7 @@ impl<'tcx> LateLintPass<'tcx> for DerivableImpls {
247248 && !attrs. iter ( ) . any ( |attr| attr. doc_str ( ) . is_some ( ) )
248249 && cx. tcx . hir_attrs ( impl_item_hir) . is_empty ( )
249250 {
250- let is_const = of_trait . constness == hir:: Constness :: Const ;
251+ let is_const = constness == hir:: Constness :: Const ;
251252 if adt_def. is_struct ( ) {
252253 check_struct (
253254 cx,
Original file line number Diff line number Diff line change @@ -495,20 +495,22 @@ pub fn eq_item_kind(l: &ItemKind, r: &ItemKind) -> bool {
495495 of_trait : lot,
496496 self_ty : lst,
497497 items : li,
498+ constness : lc,
498499 } ) ,
499500 Impl ( ast:: Impl {
500501 generics : rg,
501502 of_trait : rot,
502503 self_ty : rst,
503504 items : ri,
505+ constness : rc,
504506 } ) ,
505507 ) => {
506508 eq_generics ( lg, rg)
507509 && both ( lot. as_deref ( ) , rot. as_deref ( ) , |l, r| {
508510 matches ! ( l. safety, Safety :: Default ) == matches ! ( r. safety, Safety :: Default )
509511 && matches ! ( l. polarity, ImplPolarity :: Positive ) == matches ! ( r. polarity, ImplPolarity :: Positive )
510512 && eq_defaultness ( l. defaultness , r. defaultness )
511- && matches ! ( l . constness , ast:: Const :: No ) == matches ! ( r . constness , ast:: Const :: No )
513+ && matches ! ( lc , ast:: Const :: No ) == matches ! ( rc , ast:: Const :: No )
512514 && eq_path ( & l. trait_ref . path , & r. trait_ref . path )
513515 } )
514516 && eq_ty ( lst, rst)
You can’t perform that action at this time.
0 commit comments