@@ -569,17 +569,17 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
569569 . bindings
570570 . iter ( )
571571 . map ( |binding| {
572- let kind = match binding. kind {
573- hir:: TypeBindingKind :: Equality { ref term } => match term {
574- hir:: Term :: Ty ( ref ty) => {
572+ let kind = match & binding. kind {
573+ hir:: TypeBindingKind :: Equality { term } => match term {
574+ hir:: Term :: Ty ( ty) => {
575575 ConvertedBindingKind :: Equality ( self . ast_ty_to_ty ( ty) . into ( ) )
576576 }
577- hir:: Term :: Const ( ref c) => {
577+ hir:: Term :: Const ( c) => {
578578 let c = Const :: from_anon_const ( self . tcx ( ) , c. def_id ) ;
579579 ConvertedBindingKind :: Equality ( c. into ( ) )
580580 }
581581 } ,
582- hir:: TypeBindingKind :: Constraint { ref bounds } => {
582+ hir:: TypeBindingKind :: Constraint { bounds } => {
583583 ConvertedBindingKind :: Constraint ( bounds)
584584 }
585585 } ;
@@ -1928,7 +1928,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
19281928 ) -> Result < ( Ty < ' tcx > , DefKind , DefId ) , ErrorGuaranteed > {
19291929 let tcx = self . tcx ( ) ;
19301930 let assoc_ident = assoc_segment. ident ;
1931- let qself_res = if let hir:: TyKind :: Path ( hir:: QPath :: Resolved ( _, ref path) ) = qself. kind {
1931+ let qself_res = if let hir:: TyKind :: Path ( hir:: QPath :: Resolved ( _, path) ) = & qself. kind {
19321932 path. res
19331933 } else {
19341934 Res :: Err
@@ -1971,8 +1971,8 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
19711971 return ;
19721972 } ;
19731973 let ( qself_sugg_span, is_self) = if let hir:: TyKind :: Path (
1974- hir:: QPath :: Resolved ( _, ref path)
1975- ) = qself. kind {
1974+ hir:: QPath :: Resolved ( _, path)
1975+ ) = & qself. kind {
19761976 // If the path segment already has type params, we want to overwrite
19771977 // them.
19781978 match & path. segments [ ..] {
@@ -2760,7 +2760,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
27602760 "generic `Self` types are currently not permitted in anonymous constants" ,
27612761 ) ;
27622762 if let Some ( hir:: Node :: Item ( & hir:: Item {
2763- kind : hir:: ItemKind :: Impl ( ref impl_) ,
2763+ kind : hir:: ItemKind :: Impl ( impl_) ,
27642764 ..
27652765 } ) ) = tcx. hir ( ) . get_if_local ( def_id)
27662766 {
@@ -2843,12 +2843,12 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
28432843 fn ast_ty_to_ty_inner ( & self , ast_ty : & hir:: Ty < ' _ > , borrowed : bool , in_path : bool ) -> Ty < ' tcx > {
28442844 let tcx = self . tcx ( ) ;
28452845
2846- let result_ty = match ast_ty. kind {
2847- hir:: TyKind :: Slice ( ref ty) => tcx. mk_slice ( self . ast_ty_to_ty ( ty) ) ,
2848- hir:: TyKind :: Ptr ( ref mt) => {
2846+ let result_ty = match & ast_ty. kind {
2847+ hir:: TyKind :: Slice ( ty) => tcx. mk_slice ( self . ast_ty_to_ty ( ty) ) ,
2848+ hir:: TyKind :: Ptr ( mt) => {
28492849 tcx. mk_ptr ( ty:: TypeAndMut { ty : self . ast_ty_to_ty ( mt. ty ) , mutbl : mt. mutbl } )
28502850 }
2851- hir:: TyKind :: Ref ( ref region, ref mt) => {
2851+ hir:: TyKind :: Ref ( region, mt) => {
28522852 let r = self . ast_region_to_region ( region, None ) ;
28532853 debug ! ( ?r) ;
28542854 let t = self . ast_ty_to_ty_inner ( mt. ty , true , false ) ;
@@ -2868,38 +2868,38 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
28682868 Some ( ast_ty) ,
28692869 ) )
28702870 }
2871- hir:: TyKind :: TraitObject ( bounds, ref lifetime, repr) => {
2871+ hir:: TyKind :: TraitObject ( bounds, lifetime, repr) => {
28722872 self . maybe_lint_bare_trait ( ast_ty, in_path) ;
28732873 let repr = match repr {
28742874 TraitObjectSyntax :: Dyn | TraitObjectSyntax :: None => ty:: Dyn ,
28752875 TraitObjectSyntax :: DynStar => ty:: DynStar ,
28762876 } ;
28772877 self . conv_object_ty_poly_trait_ref ( ast_ty. span , bounds, lifetime, borrowed, repr)
28782878 }
2879- hir:: TyKind :: Path ( hir:: QPath :: Resolved ( ref maybe_qself, ref path) ) => {
2879+ hir:: TyKind :: Path ( hir:: QPath :: Resolved ( maybe_qself, path) ) => {
28802880 debug ! ( ?maybe_qself, ?path) ;
28812881 let opt_self_ty = maybe_qself. as_ref ( ) . map ( |qself| self . ast_ty_to_ty ( qself) ) ;
28822882 self . res_to_ty ( opt_self_ty, path, false )
28832883 }
28842884 hir:: TyKind :: OpaqueDef ( item_id, lifetimes, in_trait) => {
2885- let opaque_ty = tcx. hir ( ) . item ( item_id) ;
2885+ let opaque_ty = tcx. hir ( ) . item ( * item_id) ;
28862886 let def_id = item_id. owner_id . to_def_id ( ) ;
28872887
28882888 match opaque_ty. kind {
28892889 hir:: ItemKind :: OpaqueTy ( hir:: OpaqueTy { origin, .. } ) => {
2890- self . impl_trait_ty_to_ty ( def_id, lifetimes, origin, in_trait)
2890+ self . impl_trait_ty_to_ty ( def_id, lifetimes, origin, * in_trait)
28912891 }
28922892 ref i => bug ! ( "`impl Trait` pointed to non-opaque type?? {:#?}" , i) ,
28932893 }
28942894 }
2895- hir:: TyKind :: Path ( hir:: QPath :: TypeRelative ( ref qself, ref segment) ) => {
2895+ hir:: TyKind :: Path ( hir:: QPath :: TypeRelative ( qself, segment) ) => {
28962896 debug ! ( ?qself, ?segment) ;
28972897 let ty = self . ast_ty_to_ty_inner ( qself, false , true ) ;
28982898 self . associated_path_to_ty ( ast_ty. hir_id , ast_ty. span , ty, qself, segment, false )
28992899 . map ( |( ty, _, _) | ty)
29002900 . unwrap_or_else ( |_| tcx. ty_error ( ) )
29012901 }
2902- hir:: TyKind :: Path ( hir:: QPath :: LangItem ( lang_item, span, _) ) => {
2902+ & hir:: TyKind :: Path ( hir:: QPath :: LangItem ( lang_item, span, _) ) => {
29032903 let def_id = tcx. require_lang_item ( lang_item, Some ( span) ) ;
29042904 let ( substs, _) = self . create_substs_for_ast_path (
29052905 span,
@@ -2913,7 +2913,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
29132913 ) ;
29142914 EarlyBinder ( tcx. at ( span) . type_of ( def_id) ) . subst ( tcx, substs)
29152915 }
2916- hir:: TyKind :: Array ( ref ty, ref length) => {
2916+ hir:: TyKind :: Array ( ty, length) => {
29172917 let length = match length {
29182918 & hir:: ArrayLen :: Infer ( _, span) => self . ct_infer ( tcx. types . usize , None , span) ,
29192919 hir:: ArrayLen :: Body ( constant) => {
@@ -2923,7 +2923,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
29232923
29242924 tcx. mk_ty ( ty:: Array ( self . ast_ty_to_ty ( ty) , length) )
29252925 }
2926- hir:: TyKind :: Typeof ( ref e) => {
2926+ hir:: TyKind :: Typeof ( e) => {
29272927 let ty_erased = tcx. type_of ( e. def_id ) ;
29282928 let ty = tcx. fold_regions ( ty_erased, |r, _| {
29292929 if r. is_erased ( ) { tcx. lifetimes . re_static } else { r }
0 commit comments