Skip to content

Commit 1ae1a63

Browse files
committed
Add ParamKindOrd::ConstUnordered variant
1 parent 319c4f4 commit 1ae1a63

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/librustc_ast/ast.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ pub enum ParamKindOrd {
314314
Lifetime,
315315
Type,
316316
Const,
317+
ConstUnordered,
317318
}
318319

319320
impl fmt::Display for ParamKindOrd {
@@ -322,6 +323,7 @@ impl fmt::Display for ParamKindOrd {
322323
ParamKindOrd::Lifetime => "lifetime".fmt(f),
323324
ParamKindOrd::Type => "type".fmt(f),
324325
ParamKindOrd::Const => "const".fmt(f),
326+
ParamKindOrd::ConstUnordered => "const".fmt(f),
325327
}
326328
}
327329
}

src/librustc_ast_passes/ast_validation.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -735,8 +735,7 @@ fn validate_generic_param_order<'a>(
735735
}
736736
let max_param = &mut max_param;
737737
match max_param {
738-
Some(ParamKindOrd::Const)
739-
if ParamKindOrd::Type == kind && sess.features_untracked().const_generics => {}
738+
Some(ParamKindOrd::ConstUnordered) if kind != ParamKindOrd::Lifetime => (),
740739
Some(max_param) if *max_param > kind => {
741740
let entry = out_of_order.entry(kind).or_insert((*max_param, vec![]));
742741
entry.1.push(span);

0 commit comments

Comments
 (0)