@@ -15,7 +15,7 @@ use rustc_middle::hir::nested_filter;
15
15
use rustc_middle:: traits:: Reveal ;
16
16
use rustc_middle:: ty:: {
17
17
self , Binder , BoundConstness , GenericParamDefKind , ImplPolarity , ParamEnv , PredicateKind , TraitPredicate , TraitRef ,
18
- Ty , TyCtxt , Visibility ,
18
+ Ty , TyCtxt ,
19
19
} ;
20
20
use rustc_session:: { declare_lint_pass, declare_tool_lint} ;
21
21
use rustc_span:: source_map:: Span ;
@@ -425,7 +425,7 @@ struct UnsafeVisitor<'a, 'tcx> {
425
425
impl < ' tcx > Visitor < ' tcx > for UnsafeVisitor < ' _ , ' tcx > {
426
426
type NestedFilter = nested_filter:: All ;
427
427
428
- fn visit_fn ( & mut self , kind : FnKind < ' tcx > , decl : & ' tcx FnDecl < ' _ > , body_id : BodyId , span : Span , id : HirId ) {
428
+ fn visit_fn ( & mut self , kind : FnKind < ' tcx > , decl : & ' tcx FnDecl < ' _ > , body_id : BodyId , _ : Span , id : HirId ) {
429
429
if self . has_unsafe {
430
430
return ;
431
431
}
@@ -438,7 +438,7 @@ impl<'tcx> Visitor<'tcx> for UnsafeVisitor<'_, 'tcx> {
438
438
}
439
439
}
440
440
441
- walk_fn ( self , kind, decl, body_id, span , id) ;
441
+ walk_fn ( self , kind, decl, body_id, id) ;
442
442
}
443
443
444
444
fn visit_expr ( & mut self , expr : & ' tcx Expr < ' _ > ) {
@@ -464,7 +464,7 @@ impl<'tcx> Visitor<'tcx> for UnsafeVisitor<'_, 'tcx> {
464
464
fn check_partial_eq_without_eq < ' tcx > ( cx : & LateContext < ' tcx > , span : Span , trait_ref : & hir:: TraitRef < ' _ > , ty : Ty < ' tcx > ) {
465
465
if_chain ! {
466
466
if let ty:: Adt ( adt, substs) = ty. kind( ) ;
467
- if cx. tcx. visibility( adt. did( ) ) == Visibility :: Public ;
467
+ if cx. tcx. visibility( adt. did( ) ) . is_public ( ) ;
468
468
if let Some ( eq_trait_def_id) = cx. tcx. get_diagnostic_item( sym:: Eq ) ;
469
469
if let Some ( def_id) = trait_ref. trait_def_id( ) ;
470
470
if cx. tcx. is_diagnostic_item( sym:: PartialEq , def_id) ;
0 commit comments