@@ -379,7 +379,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
379379 self_ty : Ty < ' tcx > )
380380 -> ty:: TraitRef < ' tcx >
381381 {
382- self . prohibit_type_params ( trait_ref. path . segments . split_last ( ) . unwrap ( ) . 1 ) ;
382+ self . prohibit_generics ( trait_ref. path . segments . split_last ( ) . unwrap ( ) . 1 ) ;
383383
384384 let trait_def_id = self . trait_def_id ( trait_ref) ;
385385 self . ast_path_to_mono_trait_ref ( trait_ref. path . span ,
@@ -413,7 +413,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
413413
414414 debug ! ( "ast_path_to_poly_trait_ref({:?}, def_id={:?})" , trait_ref, trait_def_id) ;
415415
416- self . prohibit_type_params ( trait_ref. path . segments . split_last ( ) . unwrap ( ) . 1 ) ;
416+ self . prohibit_generics ( trait_ref. path . segments . split_last ( ) . unwrap ( ) . 1 ) ;
417417
418418 let ( substs, assoc_bindings) =
419419 self . create_substs_for_ast_trait_ref ( trait_ref. path . span ,
@@ -891,7 +891,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
891891
892892 debug ! ( "associated_path_def_to_ty: {:?}::{}" , ty, assoc_name) ;
893893
894- self . prohibit_type_params ( slice:: from_ref ( item_segment) ) ;
894+ self . prohibit_generics ( slice:: from_ref ( item_segment) ) ;
895895
896896 // Find the type of the associated item, and the trait where the associated
897897 // item is declared.
@@ -968,7 +968,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
968968 let tcx = self . tcx ( ) ;
969969 let trait_def_id = tcx. parent_def_id ( item_def_id) . unwrap ( ) ;
970970
971- self . prohibit_type_params ( slice:: from_ref ( item_segment) ) ;
971+ self . prohibit_generics ( slice:: from_ref ( item_segment) ) ;
972972
973973 let self_ty = if let Some ( ty) = opt_self_ty {
974974 ty
@@ -993,7 +993,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
993993 self . normalize_ty ( span, tcx. mk_projection ( item_def_id, trait_ref. substs ) )
994994 }
995995
996- pub fn prohibit_type_params ( & self , segments : & [ hir:: PathSegment ] ) {
996+ pub fn prohibit_generics ( & self , segments : & [ hir:: PathSegment ] ) {
997997 for segment in segments {
998998 segment. with_generic_args ( |generic_args| {
999999 let ( mut err_for_lt, mut err_for_ty) = ( false , false ) ;
@@ -1053,21 +1053,21 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
10531053 Def :: Enum ( did) | Def :: TyAlias ( did) | Def :: Struct ( did) |
10541054 Def :: Union ( did) | Def :: TyForeign ( did) => {
10551055 assert_eq ! ( opt_self_ty, None ) ;
1056- self . prohibit_type_params ( path. segments . split_last ( ) . unwrap ( ) . 1 ) ;
1056+ self . prohibit_generics ( path. segments . split_last ( ) . unwrap ( ) . 1 ) ;
10571057 self . ast_path_to_ty ( span, did, path. segments . last ( ) . unwrap ( ) )
10581058 }
10591059 Def :: Variant ( did) if permit_variants => {
10601060 // Convert "variant type" as if it were a real type.
10611061 // The resulting `Ty` is type of the variant's enum for now.
10621062 assert_eq ! ( opt_self_ty, None ) ;
1063- self . prohibit_type_params ( path. segments . split_last ( ) . unwrap ( ) . 1 ) ;
1063+ self . prohibit_generics ( path. segments . split_last ( ) . unwrap ( ) . 1 ) ;
10641064 self . ast_path_to_ty ( span,
10651065 tcx. parent_def_id ( did) . unwrap ( ) ,
10661066 path. segments . last ( ) . unwrap ( ) )
10671067 }
10681068 Def :: TyParam ( did) => {
10691069 assert_eq ! ( opt_self_ty, None ) ;
1070- self . prohibit_type_params ( & path. segments ) ;
1070+ self . prohibit_generics ( & path. segments ) ;
10711071
10721072 let node_id = tcx. hir . as_local_node_id ( did) . unwrap ( ) ;
10731073 let item_id = tcx. hir . get_parent_node ( node_id) ;
@@ -1080,18 +1080,18 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
10801080 // Self in impl (we know the concrete type).
10811081
10821082 assert_eq ! ( opt_self_ty, None ) ;
1083- self . prohibit_type_params ( & path. segments ) ;
1083+ self . prohibit_generics ( & path. segments ) ;
10841084
10851085 tcx. at ( span) . type_of ( def_id)
10861086 }
10871087 Def :: SelfTy ( Some ( _) , None ) => {
10881088 // Self in trait.
10891089 assert_eq ! ( opt_self_ty, None ) ;
1090- self . prohibit_type_params ( & path. segments ) ;
1090+ self . prohibit_generics ( & path. segments ) ;
10911091 tcx. mk_self_type ( )
10921092 }
10931093 Def :: AssociatedTy ( def_id) => {
1094- self . prohibit_type_params ( & path. segments [ ..path. segments . len ( ) -2 ] ) ;
1094+ self . prohibit_generics ( & path. segments [ ..path. segments . len ( ) -2 ] ) ;
10951095 self . qpath_to_ty ( span,
10961096 opt_self_ty,
10971097 def_id,
@@ -1100,7 +1100,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
11001100 }
11011101 Def :: PrimTy ( prim_ty) => {
11021102 assert_eq ! ( opt_self_ty, None ) ;
1103- self . prohibit_type_params ( & path. segments ) ;
1103+ self . prohibit_generics ( & path. segments ) ;
11041104 match prim_ty {
11051105 hir:: TyBool => tcx. types . bool ,
11061106 hir:: TyChar => tcx. types . char ,
0 commit comments