about summary refs log tree commit diff
path: root/compiler/rustc_parse/messages.ftl
diff options
context:
space:
mode:
authorTakayuki Maeda <takoyaki0316@gmail.com>2023-11-27 22:38:25 +0900
committerGitHub <noreply@github.com>2023-11-27 22:38:25 +0900
commit215d84a8801a585b2ae99af15d2178d13901543c (patch)
tree37bb4392d5d2ccc8b4101257aca8357a9e78656e /compiler/rustc_parse/messages.ftl
parent465c4c9885d6abba54ff55f07d9cca927d74a3aa (diff)
parentf4c2bdeec9d53c6a7221ebfdb2d995932dff9648 (diff)
downloadrust-215d84a8801a585b2ae99af15d2178d13901543c.tar.gz
rust-215d84a8801a585b2ae99af15d2178d13901543c.zip
Rollup merge of #118359 - hkmatsumoto:suggest-box-ref, r=TaKO8Ki
Suggest swapping the order of `ref` and `box`

It is not valid grammar to write `ref box <ident>` in patterns, but `box ref <ident>` is.
This patch adds a diagnostic to suggest swapping them, analogous to what we do for `mut let`.
Diffstat (limited to 'compiler/rustc_parse/messages.ftl')
-rw-r--r--compiler/rustc_parse/messages.ftl3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc_parse/messages.ftl b/compiler/rustc_parse/messages.ftl
index 49a2c414467..83bbfeb2805 100644
--- a/compiler/rustc_parse/messages.ftl
+++ b/compiler/rustc_parse/messages.ftl
@@ -721,6 +721,9 @@ parse_sugg_wrap_pattern_in_parens = wrap the pattern in parentheses
 parse_switch_mut_let_order =
     switch the order of `mut` and `let`
 
+parse_switch_ref_box_order = switch the order of `ref` and `box`
+    .suggestion = swap them
+
 parse_ternary_operator = Rust has no ternary operator
     .help = use an `if-else` expression instead