@@ -894,7 +894,6 @@ impl<'a> AstValidator<'a> {
894
894
/// Checks that generic parameters are in the correct order,
895
895
/// which is lifetimes, then types and then consts. (`<'a, T, const N: usize>`)
896
896
fn validate_generic_param_order (
897
- sess : & Session ,
898
897
handler : & rustc_errors:: Handler ,
899
898
generics : & [ GenericParam ] ,
900
899
span : Span ,
@@ -911,8 +910,7 @@ fn validate_generic_param_order(
911
910
GenericParamKind :: Type { default : _ } => ( ParamKindOrd :: Type , ident. to_string ( ) ) ,
912
911
GenericParamKind :: Const { ref ty, kw_span : _, default : _ } => {
913
912
let ty = pprust:: ty_to_string ( ty) ;
914
- let unordered = sess. features_untracked ( ) . unordered_const_ty_params ( ) ;
915
- ( ParamKindOrd :: Const { unordered } , format ! ( "const {}: {}" , ident, ty) )
913
+ ( ParamKindOrd :: Const , format ! ( "const {}: {}" , ident, ty) )
916
914
}
917
915
} ;
918
916
param_idents. push ( ( kind, ord_kind, bounds, idx, ident) ) ;
@@ -968,14 +966,7 @@ fn validate_generic_param_order(
968
966
) ;
969
967
err. span_suggestion (
970
968
span,
971
- & format ! (
972
- "reorder the parameters: lifetimes, {}" ,
973
- if sess. features_untracked( ) . unordered_const_ty_params( ) {
974
- "then consts and types"
975
- } else {
976
- "then types, then consts"
977
- }
978
- ) ,
969
+ "reorder the parameters: lifetimes, then consts and types" ,
979
970
ordered_params. clone ( ) ,
980
971
Applicability :: MachineApplicable ,
981
972
) ;
@@ -1342,8 +1333,6 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
1342
1333
}
1343
1334
1344
1335
fn visit_generics ( & mut self , generics : & ' a Generics ) {
1345
- let cg_defaults = self . session . features_untracked ( ) . unordered_const_ty_params ( ) ;
1346
-
1347
1336
let mut prev_param_default = None ;
1348
1337
for param in & generics. params {
1349
1338
match param. kind {
@@ -1358,25 +1347,14 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
1358
1347
span,
1359
1348
"generic parameters with a default must be trailing" ,
1360
1349
) ;
1361
- if matches ! ( param. kind, GenericParamKind :: Const { .. } ) && !cg_defaults {
1362
- err. note (
1363
- "using type defaults and const parameters \
1364
- in the same parameter list is currently not permitted",
1365
- ) ;
1366
- }
1367
1350
err. emit ( ) ;
1368
1351
break ;
1369
1352
}
1370
1353
}
1371
1354
}
1372
1355
}
1373
1356
1374
- validate_generic_param_order (
1375
- self . session ,
1376
- self . err_handler ( ) ,
1377
- & generics. params ,
1378
- generics. span ,
1379
- ) ;
1357
+ validate_generic_param_order ( self . err_handler ( ) , & generics. params , generics. span ) ;
1380
1358
1381
1359
for predicate in & generics. where_clause . predicates {
1382
1360
if let WherePredicate :: EqPredicate ( ref predicate) = * predicate {
0 commit comments