@@ -223,7 +223,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
223223 Some ( ref name) => format ! ( "`{}`" , name) ,
224224 None => "value" . to_owned ( ) ,
225225 } ;
226- if let ty:: TyKind :: Param ( param_ty) = ty. sty {
226+ if let ty:: Param ( param_ty) = ty. sty {
227227 let tcx = self . infcx . tcx ;
228228 let generics = tcx. generics_of ( self . mir_def_id ) ;
229229 let def_id = generics. type_param ( & param_ty, tcx) . def_id ;
@@ -1529,7 +1529,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
15291529 if let TerminatorKind :: Call {
15301530 func : Operand :: Constant ( box Constant {
15311531 literal : ty:: Const {
1532- ty : & ty:: TyS { sty : ty:: TyKind :: FnDef ( id, _) , .. } ,
1532+ ty : & ty:: TyS { sty : ty:: FnDef ( id, _) , .. } ,
15331533 ..
15341534 } ,
15351535 ..
@@ -1547,7 +1547,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
15471547 } ;
15481548
15491549 debug ! ( "add_moved_or_invoked_closure_note: closure={:?}" , closure) ;
1550- if let ty:: TyKind :: Closure ( did, _) = self . mir . local_decls [ closure] . ty . sty {
1550+ if let ty:: Closure ( did, _) = self . mir . local_decls [ closure] . ty . sty {
15511551 let hir_id = self . infcx . tcx . hir ( ) . as_local_hir_id ( did) . unwrap ( ) ;
15521552
15531553 if let Some ( ( span, name) ) = self . infcx . tcx . typeck_tables_of ( did)
@@ -1570,7 +1570,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
15701570
15711571 // Check if we are just moving a closure after it has been invoked.
15721572 if let Some ( target) = target {
1573- if let ty:: TyKind :: Closure ( did, _) = self . mir . local_decls [ target] . ty . sty {
1573+ if let ty:: Closure ( did, _) = self . mir . local_decls [ target] . ty . sty {
15741574 let hir_id = self . infcx . tcx . hir ( ) . as_local_hir_id ( did) . unwrap ( ) ;
15751575
15761576 if let Some ( ( span, name) ) = self . infcx . tcx . typeck_tables_of ( did)
@@ -1919,7 +1919,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
19191919 } else {
19201920 let ty = self . infcx . tcx . type_of ( self . mir_def_id ) ;
19211921 match ty. sty {
1922- ty:: TyKind :: FnDef ( _, _) | ty:: TyKind :: FnPtr ( _) => self . annotate_fn_sig (
1922+ ty:: FnDef ( _, _) | ty:: FnPtr ( _) => self . annotate_fn_sig (
19231923 self . mir_def_id ,
19241924 self . infcx . tcx . fn_sig ( self . mir_def_id ) ,
19251925 ) ,
@@ -2164,12 +2164,12 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
21642164 // anything.
21652165 let return_ty = sig. output ( ) ;
21662166 match return_ty. skip_binder ( ) . sty {
2167- ty:: TyKind :: Ref ( return_region, _, _) if return_region. has_name ( ) && !is_closure => {
2167+ ty:: Ref ( return_region, _, _) if return_region. has_name ( ) && !is_closure => {
21682168 // This is case 1 from above, return type is a named reference so we need to
21692169 // search for relevant arguments.
21702170 let mut arguments = Vec :: new ( ) ;
21712171 for ( index, argument) in sig. inputs ( ) . skip_binder ( ) . iter ( ) . enumerate ( ) {
2172- if let ty:: TyKind :: Ref ( argument_region, _, _) = argument. sty {
2172+ if let ty:: Ref ( argument_region, _, _) = argument. sty {
21732173 if argument_region == return_region {
21742174 // Need to use the `rustc::ty` types to compare against the
21752175 // `return_region`. Then use the `rustc::hir` type to get only
@@ -2206,7 +2206,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
22062206 return_span,
22072207 } )
22082208 }
2209- ty:: TyKind :: Ref ( _, _, _) if is_closure => {
2209+ ty:: Ref ( _, _, _) if is_closure => {
22102210 // This is case 2 from above but only for closures, return type is anonymous
22112211 // reference so we select
22122212 // the first argument.
@@ -2215,9 +2215,9 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
22152215
22162216 // Closure arguments are wrapped in a tuple, so we need to get the first
22172217 // from that.
2218- if let ty:: TyKind :: Tuple ( elems) = argument_ty. sty {
2218+ if let ty:: Tuple ( elems) = argument_ty. sty {
22192219 let argument_ty = elems. first ( ) ?;
2220- if let ty:: TyKind :: Ref ( _, _, _) = argument_ty. sty {
2220+ if let ty:: Ref ( _, _, _) = argument_ty. sty {
22212221 return Some ( AnnotatedBorrowFnSignature :: Closure {
22222222 argument_ty,
22232223 argument_span,
@@ -2227,7 +2227,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
22272227
22282228 None
22292229 }
2230- ty:: TyKind :: Ref ( _, _, _) => {
2230+ ty:: Ref ( _, _, _) => {
22312231 // This is also case 2 from above but for functions, return type is still an
22322232 // anonymous reference so we select the first argument.
22332233 let argument_span = fn_decl. inputs . first ( ) ?. span ;
@@ -2238,7 +2238,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
22382238
22392239 // We expect the first argument to be a reference.
22402240 match argument_ty. sty {
2241- ty:: TyKind :: Ref ( _, _, _) => { }
2241+ ty:: Ref ( _, _, _) => { }
22422242 _ => return None ,
22432243 }
22442244
@@ -2366,8 +2366,8 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
23662366 // this by hooking into the pretty printer and telling it to label the
23672367 // lifetimes without names with the value `'0`.
23682368 match ty. sty {
2369- ty:: TyKind :: Ref ( ty:: RegionKind :: ReLateBound ( _, br) , _, _)
2370- | ty:: TyKind :: Ref (
2369+ ty:: Ref ( ty:: RegionKind :: ReLateBound ( _, br) , _, _)
2370+ | ty:: Ref (
23712371 ty:: RegionKind :: RePlaceholder ( ty:: PlaceholderRegion { name : br, .. } ) ,
23722372 _,
23732373 _,
@@ -2386,7 +2386,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
23862386 let mut printer = ty:: print:: FmtPrinter :: new ( self . infcx . tcx , & mut s, Namespace :: TypeNS ) ;
23872387
23882388 let region = match ty. sty {
2389- ty:: TyKind :: Ref ( region, _, _) => {
2389+ ty:: Ref ( region, _, _) => {
23902390 match region {
23912391 ty:: RegionKind :: ReLateBound ( _, br)
23922392 | ty:: RegionKind :: RePlaceholder ( ty:: PlaceholderRegion { name : br, .. } ) => {
0 commit comments