We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7212685 commit eafa3a8Copy full SHA for eafa3a8
src/librustc/hir/lowering.rs
@@ -1083,6 +1083,18 @@ impl<'a> LoweringContext<'a> {
1083
.chain(in_band_defs)
1084
.collect();
1085
1086
+ // FIXME(const_generics): the compiler doesn't always cope with
1087
+ // unsorted generic parameters at the moment, so we make sure
1088
+ // that they're ordered correctly here for now. (When we chain
1089
+ // the `in_band_defs`, we might make the order unsorted.)
1090
+ lowered_generics.params.sort_by_key(|param| {
1091
+ match param.kind {
1092
+ hir::GenericParamKind::Lifetime { .. } => ParamKindOrd::Lifetime,
1093
+ hir::GenericParamKind::Type { .. } => ParamKindOrd::Type,
1094
+ hir::GenericParamKind::Const { .. } => ParamKindOrd::Const,
1095
+ }
1096
+ });
1097
+
1098
(lowered_generics, res)
1099
}
1100
0 commit comments