@@ -1819,7 +1819,7 @@ fn ty_of_method_or_bare_fn<'a, 'tcx>(this: &AstConv<'tcx>,
18191819 // reference) in the arguments, then any anonymous regions in the output
18201820 // have that lifetime.
18211821 let implied_output_region = match explicit_self_category {
1822- Some ( ty:: ByReferenceExplicitSelfCategory ( region, _) ) => Ok ( region) ,
1822+ Some ( ty:: ExplicitSelfCategory :: ByReference ( region, _) ) => Ok ( region) ,
18231823 _ => find_implied_output_region ( this. tcx ( ) , & arg_tys, arg_pats)
18241824 } ;
18251825
@@ -1850,9 +1850,9 @@ fn determine_self_type<'a, 'tcx>(this: &AstConv<'tcx>,
18501850{
18511851 let self_ty = self_info. untransformed_self_ty ;
18521852 return match self_info. explicit_self . node {
1853- hir:: SelfStatic => ( None , Some ( ty:: StaticExplicitSelfCategory ) ) ,
1853+ hir:: SelfStatic => ( None , Some ( ty:: ExplicitSelfCategory :: Static ) ) ,
18541854 hir:: SelfValue ( _) => {
1855- ( Some ( self_ty) , Some ( ty:: ByValueExplicitSelfCategory ) )
1855+ ( Some ( self_ty) , Some ( ty:: ExplicitSelfCategory :: ByValue ) )
18561856 }
18571857 hir:: SelfRegion ( ref lifetime, mutability, _) => {
18581858 let region =
@@ -1866,7 +1866,7 @@ fn determine_self_type<'a, 'tcx>(this: &AstConv<'tcx>,
18661866 ty : self_ty,
18671867 mutbl : mutability
18681868 } ) ) ,
1869- Some ( ty:: ByReferenceExplicitSelfCategory ( region, mutability) ) )
1869+ Some ( ty:: ExplicitSelfCategory :: ByReference ( region, mutability) ) )
18701870 }
18711871 hir:: SelfExplicit ( ref ast_type, _) => {
18721872 let explicit_type = ast_ty_to_ty ( this, rscope, & * * ast_type) ;
@@ -1882,12 +1882,12 @@ fn determine_self_type<'a, 'tcx>(this: &AstConv<'tcx>,
18821882 // ```
18831883 // impl Foo for &T {
18841884 // // Legal declarations:
1885- // fn method1(self: &&T); // ByReferenceExplicitSelfCategory
1886- // fn method2(self: &T); // ByValueExplicitSelfCategory
1887- // fn method3(self: Box<&T>); // ByBoxExplicitSelfCategory
1885+ // fn method1(self: &&T); // ExplicitSelfCategory::ByReference
1886+ // fn method2(self: &T); // ExplicitSelfCategory::ByValue
1887+ // fn method3(self: Box<&T>); // ExplicitSelfCategory::ByBox
18881888 //
18891889 // // Invalid cases will be caught later by `check_method_self_type`:
1890- // fn method_err1(self: &mut T); // ByReferenceExplicitSelfCategory
1890+ // fn method_err1(self: &mut T); // ExplicitSelfCategory::ByReference
18911891 // }
18921892 // ```
18931893 //
@@ -1898,7 +1898,7 @@ fn determine_self_type<'a, 'tcx>(this: &AstConv<'tcx>,
18981898 // call it by-ref, by-box as appropriate. For method1, for
18991899 // example, the impl type has one modifier, but the method
19001900 // type has two, so we end up with
1901- // ByReferenceExplicitSelfCategory .
1901+ // ExplicitSelfCategory::ByReference .
19021902
19031903 let impl_modifiers = count_modifiers ( self_info. untransformed_self_ty ) ;
19041904 let method_modifiers = count_modifiers ( explicit_type) ;
@@ -1912,12 +1912,12 @@ fn determine_self_type<'a, 'tcx>(this: &AstConv<'tcx>,
19121912 method_modifiers) ;
19131913
19141914 let category = if impl_modifiers >= method_modifiers {
1915- ty:: ByValueExplicitSelfCategory
1915+ ty:: ExplicitSelfCategory :: ByValue
19161916 } else {
19171917 match explicit_type. sty {
1918- ty:: TyRef ( r, mt) => ty:: ByReferenceExplicitSelfCategory ( * r, mt. mutbl ) ,
1919- ty:: TyBox ( _) => ty:: ByBoxExplicitSelfCategory ,
1920- _ => ty:: ByValueExplicitSelfCategory ,
1918+ ty:: TyRef ( r, mt) => ty:: ExplicitSelfCategory :: ByReference ( * r, mt. mutbl ) ,
1919+ ty:: TyBox ( _) => ty:: ExplicitSelfCategory :: ByBox ,
1920+ _ => ty:: ExplicitSelfCategory :: ByValue ,
19211921 }
19221922 } ;
19231923
0 commit comments