File tree Expand file tree Collapse file tree 2 files changed +2
-25
lines changed Expand file tree Collapse file tree 2 files changed +2
-25
lines changed Original file line number Diff line number Diff line change @@ -2886,15 +2886,6 @@ impl<'a> LoweringContext<'a> {
2886
2886
( param_name, kind)
2887
2887
}
2888
2888
GenericParamKind :: Type { ref default, .. } => {
2889
- // Don't expose `Self` (recovered "keyword used as ident" parse error).
2890
- // `rustc::ty` expects `Self` to be only used for a trait's `Self`.
2891
- // Instead, use `gensym("Self")` to create a distinct name that looks the same.
2892
- let ident = if param. ident . name == kw:: SelfUpper {
2893
- param. ident . gensym ( )
2894
- } else {
2895
- param. ident
2896
- } ;
2897
-
2898
2889
let add_bounds = add_bounds. get ( & param. id ) . map_or ( & [ ] [ ..] , |x| & x) ;
2899
2890
if !add_bounds. is_empty ( ) {
2900
2891
let params = self . lower_param_bounds ( add_bounds, itctx. reborrow ( ) ) . into_iter ( ) ;
@@ -2913,7 +2904,7 @@ impl<'a> LoweringContext<'a> {
2913
2904
. next ( ) ,
2914
2905
} ;
2915
2906
2916
- ( hir:: ParamName :: Plain ( ident) , kind)
2907
+ ( hir:: ParamName :: Plain ( param . ident ) , kind)
2917
2908
}
2918
2909
GenericParamKind :: Const { ref ty } => {
2919
2910
( hir:: ParamName :: Plain ( param. ident ) , hir:: GenericParamKind :: Const {
Original file line number Diff line number Diff line change @@ -1011,13 +1011,6 @@ fn generics_of(tcx: TyCtxt<'_>, def_id: DefId) -> &ty::Generics {
1011
1011
synthetic,
1012
1012
..
1013
1013
} => {
1014
- if param. name . ident ( ) . name == kw:: SelfUpper {
1015
- span_bug ! (
1016
- param. span,
1017
- "`Self` should not be the name of a regular parameter"
1018
- ) ;
1019
- }
1020
-
1021
1014
if !allow_defaults && default. is_some ( ) {
1022
1015
if !tcx. features ( ) . default_type_parameter_fallback {
1023
1016
tcx. lint_hir (
@@ -1041,13 +1034,6 @@ fn generics_of(tcx: TyCtxt<'_>, def_id: DefId) -> &ty::Generics {
1041
1034
}
1042
1035
}
1043
1036
GenericParamKind :: Const { .. } => {
1044
- if param. name . ident ( ) . name == kw:: SelfUpper {
1045
- span_bug ! (
1046
- param. span,
1047
- "`Self` should not be the name of a regular parameter" ,
1048
- ) ;
1049
- }
1050
-
1051
1037
ty:: GenericParamDefKind :: Const
1052
1038
}
1053
1039
_ => return None ,
@@ -1569,7 +1555,7 @@ fn find_opaque_ty_constraints(tcx: TyCtxt<'_>, def_id: DefId) -> Ty<'_> {
1569
1555
& format ! (
1570
1556
"defining opaque type use restricts opaque \
1571
1557
type by using the generic parameter `{}` twice",
1572
- p. name
1558
+ p,
1573
1559
) ,
1574
1560
) ;
1575
1561
return ;
You can’t perform that action at this time.
0 commit comments