@@ -1369,10 +1369,9 @@ impl TypeAliasBounds {
1369
1369
hir:: QPath :: TypeRelative ( ref ty, _) => {
1370
1370
// If this is a type variable, we found a `T::Assoc`.
1371
1371
match ty. kind {
1372
- hir:: TyKind :: Path ( hir:: QPath :: Resolved ( None , ref path) ) => match path. res {
1373
- Res :: Def ( DefKind :: TyParam , _) => true ,
1374
- _ => false ,
1375
- } ,
1372
+ hir:: TyKind :: Path ( hir:: QPath :: Resolved ( None , ref path) ) => {
1373
+ matches ! ( path. res, Res :: Def ( DefKind :: TyParam , _) )
1374
+ }
1376
1375
_ => false ,
1377
1376
}
1378
1377
}
@@ -2381,10 +2380,9 @@ impl<'tcx> LateLintPass<'tcx> for InvalidValue {
2381
2380
return Some ( InitKind :: Zeroed ) ;
2382
2381
} else if cx. tcx . is_diagnostic_item ( sym:: mem_uninitialized, def_id) {
2383
2382
return Some ( InitKind :: Uninit ) ;
2384
- } else if cx. tcx . is_diagnostic_item ( sym:: transmute, def_id) {
2385
- if is_zero ( & args[ 0 ] ) {
2386
- return Some ( InitKind :: Zeroed ) ;
2387
- }
2383
+ } else if cx. tcx . is_diagnostic_item ( sym:: transmute, def_id) && is_zero ( & args[ 0 ] )
2384
+ {
2385
+ return Some ( InitKind :: Zeroed ) ;
2388
2386
}
2389
2387
}
2390
2388
} else if let hir:: ExprKind :: MethodCall ( _, _, ref args, _) = expr. kind {
@@ -2880,7 +2878,7 @@ impl<'tcx> LateLintPass<'tcx> for ClashingExternDeclarations {
2880
2878
fn check_foreign_item ( & mut self , cx : & LateContext < ' tcx > , this_fi : & hir:: ForeignItem < ' _ > ) {
2881
2879
trace ! ( "ClashingExternDeclarations: check_foreign_item: {:?}" , this_fi) ;
2882
2880
if let ForeignItemKind :: Fn ( ..) = this_fi. kind {
2883
- let tcx = * & cx. tcx ;
2881
+ let tcx = cx. tcx ;
2884
2882
if let Some ( existing_hid) = self . insert ( tcx, this_fi) {
2885
2883
let existing_decl_ty = tcx. type_of ( tcx. hir ( ) . local_def_id ( existing_hid) ) ;
2886
2884
let this_decl_ty = tcx. type_of ( tcx. hir ( ) . local_def_id ( this_fi. hir_id ) ) ;
0 commit comments