@@ -421,7 +421,7 @@ fn check_fn_args<'cx, 'tcx: 'cx>(
421
421
if let ty:: Ref ( _, ty, mutability) = * ty. kind( ) ;
422
422
if let ty:: Adt ( adt, substs) = * ty. kind( ) ;
423
423
424
- if let TyKind :: Rptr ( lt, ref ty) = hir_ty. kind;
424
+ if let TyKind :: Ref ( lt, ref ty) = hir_ty. kind;
425
425
if let TyKind :: Path ( QPath :: Resolved ( None , path) ) = ty. ty. kind;
426
426
427
427
// Check that the name as typed matches the actual name of the type.
@@ -503,14 +503,14 @@ fn check_fn_args<'cx, 'tcx: 'cx>(
503
503
504
504
fn check_mut_from_ref < ' tcx > ( cx : & LateContext < ' tcx > , sig : & FnSig < ' _ > , body : Option < & ' tcx Body < ' _ > > ) {
505
505
if let FnRetTy :: Return ( ty) = sig. decl . output
506
- && let Some ( ( out, Mutability :: Mut , _) ) = get_rptr_lm ( ty)
506
+ && let Some ( ( out, Mutability :: Mut , _) ) = get_ref_lm ( ty)
507
507
{
508
508
let out_region = cx. tcx . named_region ( out. hir_id ) ;
509
509
let args: Option < Vec < _ > > = sig
510
510
. decl
511
511
. inputs
512
512
. iter ( )
513
- . filter_map ( get_rptr_lm )
513
+ . filter_map ( get_ref_lm )
514
514
. filter ( |& ( lt, _, _) | cx. tcx . named_region ( lt. hir_id ) == out_region)
515
515
. map ( |( _, mutability, span) | ( mutability == Mutability :: Not ) . then_some ( span) )
516
516
. collect ( ) ;
@@ -704,8 +704,8 @@ fn matches_preds<'tcx>(
704
704
} )
705
705
}
706
706
707
- fn get_rptr_lm < ' tcx > ( ty : & ' tcx hir:: Ty < ' tcx > ) -> Option < ( & ' tcx Lifetime , Mutability , Span ) > {
708
- if let TyKind :: Rptr ( lt, ref m) = ty. kind {
707
+ fn get_ref_lm < ' tcx > ( ty : & ' tcx hir:: Ty < ' tcx > ) -> Option < ( & ' tcx Lifetime , Mutability , Span ) > {
708
+ if let TyKind :: Ref ( lt, ref m) = ty. kind {
709
709
Some ( ( lt, m. mutbl , ty. span ) )
710
710
} else {
711
711
None
0 commit comments