Unconditionally lower generic_arg_infer
This commit is contained in:
parent
b85a91fc59
commit
6885ff4a7b
10 changed files with 91 additions and 119 deletions
|
@ -2031,11 +2031,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
|
|||
fn lower_array_length_to_const_arg(&mut self, c: &AnonConst) -> &'hir hir::ConstArg<'hir> {
|
||||
match c.value.kind {
|
||||
ExprKind::Underscore => {
|
||||
if self.tcx.features().generic_arg_infer() {
|
||||
let ct_kind = hir::ConstArgKind::Infer(self.lower_span(c.value.span));
|
||||
self.arena
|
||||
.alloc(hir::ConstArg { hir_id: self.lower_node_id(c.id), kind: ct_kind })
|
||||
} else {
|
||||
if !self.tcx.features().generic_arg_infer() {
|
||||
feature_err(
|
||||
&self.tcx.sess,
|
||||
sym::generic_arg_infer,
|
||||
|
@ -2043,8 +2039,9 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
|
|||
fluent_generated::ast_lowering_underscore_array_length_unstable,
|
||||
)
|
||||
.stash(c.value.span, StashKey::UnderscoreForArrayLengths);
|
||||
self.lower_anon_const_to_const_arg(c)
|
||||
}
|
||||
let ct_kind = hir::ConstArgKind::Infer(self.lower_span(c.value.span));
|
||||
self.arena.alloc(hir::ConstArg { hir_id: self.lower_node_id(c.id), kind: ct_kind })
|
||||
}
|
||||
_ => self.lower_anon_const_to_const_arg(c),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue