@@ -1815,7 +1815,7 @@ fn ty_of_method_or_bare_fn<'a, 'tcx>(this: &AstConv<'tcx>,
18151815 // reference) in the arguments, then any anonymous regions in the output
18161816 // have that lifetime.
18171817 let implied_output_region = match explicit_self_category {
1818- Some ( ty:: ByReferenceExplicitSelfCategory ( region, _) ) => Ok ( region) ,
1818+ Some ( ty:: ExplicitSelfCategory :: ByReference ( region, _) ) => Ok ( region) ,
18191819 _ => find_implied_output_region ( this. tcx ( ) , & arg_tys, arg_pats)
18201820 } ;
18211821
@@ -1846,9 +1846,9 @@ fn determine_self_type<'a, 'tcx>(this: &AstConv<'tcx>,
18461846{
18471847 let self_ty = self_info. untransformed_self_ty ;
18481848 return match self_info. explicit_self . node {
1849- hir:: SelfStatic => ( None , Some ( ty:: StaticExplicitSelfCategory ) ) ,
1849+ hir:: SelfStatic => ( None , Some ( ty:: ExplicitSelfCategory :: Static ) ) ,
18501850 hir:: SelfValue ( _) => {
1851- ( Some ( self_ty) , Some ( ty:: ByValueExplicitSelfCategory ) )
1851+ ( Some ( self_ty) , Some ( ty:: ExplicitSelfCategory :: ByValue ) )
18521852 }
18531853 hir:: SelfRegion ( ref lifetime, mutability, _) => {
18541854 let region =
@@ -1862,7 +1862,7 @@ fn determine_self_type<'a, 'tcx>(this: &AstConv<'tcx>,
18621862 ty : self_ty,
18631863 mutbl : mutability
18641864 } ) ) ,
1865- Some ( ty:: ByReferenceExplicitSelfCategory ( region, mutability) ) )
1865+ Some ( ty:: ExplicitSelfCategory :: ByReference ( region, mutability) ) )
18661866 }
18671867 hir:: SelfExplicit ( ref ast_type, _) => {
18681868 let explicit_type = ast_ty_to_ty ( this, rscope, & * * ast_type) ;
@@ -1878,12 +1878,12 @@ fn determine_self_type<'a, 'tcx>(this: &AstConv<'tcx>,
18781878 // ```
18791879 // impl Foo for &T {
18801880 // // Legal declarations:
1881- // fn method1(self: &&T); // ByReferenceExplicitSelfCategory
1882- // fn method2(self: &T); // ByValueExplicitSelfCategory
1883- // fn method3(self: Box<&T>); // ByBoxExplicitSelfCategory
1881+ // fn method1(self: &&T); // ExplicitSelfCategory::ByReference
1882+ // fn method2(self: &T); // ExplicitSelfCategory::ByValue
1883+ // fn method3(self: Box<&T>); // ExplicitSelfCategory::ByBox
18841884 //
18851885 // // Invalid cases will be caught later by `check_method_self_type`:
1886- // fn method_err1(self: &mut T); // ByReferenceExplicitSelfCategory
1886+ // fn method_err1(self: &mut T); // ExplicitSelfCategory::ByReference
18871887 // }
18881888 // ```
18891889 //
@@ -1894,7 +1894,7 @@ fn determine_self_type<'a, 'tcx>(this: &AstConv<'tcx>,
18941894 // call it by-ref, by-box as appropriate. For method1, for
18951895 // example, the impl type has one modifier, but the method
18961896 // type has two, so we end up with
1897- // ByReferenceExplicitSelfCategory .
1897+ // ExplicitSelfCategory::ByReference .
18981898
18991899 let impl_modifiers = count_modifiers ( self_info. untransformed_self_ty ) ;
19001900 let method_modifiers = count_modifiers ( explicit_type) ;
@@ -1908,12 +1908,12 @@ fn determine_self_type<'a, 'tcx>(this: &AstConv<'tcx>,
19081908 method_modifiers) ;
19091909
19101910 let category = if impl_modifiers >= method_modifiers {
1911- ty:: ByValueExplicitSelfCategory
1911+ ty:: ExplicitSelfCategory :: ByValue
19121912 } else {
19131913 match explicit_type. sty {
1914- ty:: TyRef ( r, mt) => ty:: ByReferenceExplicitSelfCategory ( * r, mt. mutbl ) ,
1915- ty:: TyBox ( _) => ty:: ByBoxExplicitSelfCategory ,
1916- _ => ty:: ByValueExplicitSelfCategory ,
1914+ ty:: TyRef ( r, mt) => ty:: ExplicitSelfCategory :: ByReference ( * r, mt. mutbl ) ,
1915+ ty:: TyBox ( _) => ty:: ExplicitSelfCategory :: ByBox ,
1916+ _ => ty:: ExplicitSelfCategory :: ByValue ,
19171917 }
19181918 } ;
19191919
0 commit comments