mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 06:44:35 +00:00
rustc_ast_lowering: make "using _
for array lengths is unstable" translatable
This commit is contained in:
parent
c36b21a4c8
commit
334a097137
@ -167,6 +167,9 @@ ast_lowering_template_modifier = template modifier
|
|||||||
|
|
||||||
ast_lowering_this_not_async = this is not `async`
|
ast_lowering_this_not_async = this is not `async`
|
||||||
|
|
||||||
|
ast_lowering_underscore_array_length_unstable =
|
||||||
|
using `_` for array lengths is unstable
|
||||||
|
|
||||||
ast_lowering_underscore_expr_lhs_assign =
|
ast_lowering_underscore_expr_lhs_assign =
|
||||||
in expressions, `_` can only be used on the left-hand side of an assignment
|
in expressions, `_` can only be used on the left-hand side of an assignment
|
||||||
.label = `_` not allowed here
|
.label = `_` not allowed here
|
||||||
|
@ -2326,7 +2326,6 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
|
|||||||
self.expr_block(block)
|
self.expr_block(block)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
|
|
||||||
fn lower_array_length(&mut self, c: &AnonConst) -> hir::ArrayLen<'hir> {
|
fn lower_array_length(&mut self, c: &AnonConst) -> hir::ArrayLen<'hir> {
|
||||||
match c.value.kind {
|
match c.value.kind {
|
||||||
ExprKind::Underscore => {
|
ExprKind::Underscore => {
|
||||||
@ -2340,7 +2339,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
|
|||||||
&self.tcx.sess,
|
&self.tcx.sess,
|
||||||
sym::generic_arg_infer,
|
sym::generic_arg_infer,
|
||||||
c.value.span,
|
c.value.span,
|
||||||
"using `_` for array lengths is unstable",
|
fluent_generated::ast_lowering_underscore_array_length_unstable,
|
||||||
)
|
)
|
||||||
.stash(c.value.span, StashKey::UnderscoreForArrayLengths);
|
.stash(c.value.span, StashKey::UnderscoreForArrayLengths);
|
||||||
hir::ArrayLen::Body(self.lower_anon_const_to_const_arg(c))
|
hir::ArrayLen::Body(self.lower_anon_const_to_const_arg(c))
|
||||||
|
Loading…
Reference in New Issue
Block a user