diff options
| author | Pavel Grigorenko <GrigorenkoPV@ya.ru> | 2024-08-07 23:27:31 +0300 |
|---|---|---|
| committer | Pavel Grigorenko <GrigorenkoPV@ya.ru> | 2024-08-10 14:32:55 +0300 |
| commit | 334a097137ebcf319d02a6fb54777ce2002dbe35 (patch) | |
| tree | 1c6b672b7e95637d8bd462b0ab0090bef1aca47a | |
| parent | c36b21a4c8d91d34b6461a54acda090ffd8cdc75 (diff) | |
| download | rust-334a097137ebcf319d02a6fb54777ce2002dbe35.tar.gz rust-334a097137ebcf319d02a6fb54777ce2002dbe35.zip | |
rustc_ast_lowering: make "using `_` for array lengths is unstable" translatable
| -rw-r--r-- | compiler/rustc_ast_lowering/messages.ftl | 3 | ||||
| -rw-r--r-- | compiler/rustc_ast_lowering/src/lib.rs | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/compiler/rustc_ast_lowering/messages.ftl b/compiler/rustc_ast_lowering/messages.ftl index 9ed93d481e7..9e4d5a3b88a 100644 --- a/compiler/rustc_ast_lowering/messages.ftl +++ b/compiler/rustc_ast_lowering/messages.ftl @@ -167,6 +167,9 @@ ast_lowering_template_modifier = template modifier 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 = in expressions, `_` can only be used on the left-hand side of an assignment .label = `_` not allowed here diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs index 224787c335b..81d17a9dec2 100644 --- a/compiler/rustc_ast_lowering/src/lib.rs +++ b/compiler/rustc_ast_lowering/src/lib.rs @@ -2326,7 +2326,6 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { self.expr_block(block) } - #[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable fn lower_array_length(&mut self, c: &AnonConst) -> hir::ArrayLen<'hir> { match c.value.kind { ExprKind::Underscore => { @@ -2340,7 +2339,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { &self.tcx.sess, sym::generic_arg_infer, c.value.span, - "using `_` for array lengths is unstable", + fluent_generated::ast_lowering_underscore_array_length_unstable, ) .stash(c.value.span, StashKey::UnderscoreForArrayLengths); hir::ArrayLen::Body(self.lower_anon_const_to_const_arg(c)) |
