diff options
Diffstat (limited to 'tests/ui/pattern')
4 files changed, 32 insertions, 6 deletions
diff --git a/tests/ui/pattern/bindings-after-at/wild-before-at-syntactically-rejected.stderr b/tests/ui/pattern/bindings-after-at/wild-before-at-syntactically-rejected.stderr index 2f45415844d..1599edd7a99 100644 --- a/tests/ui/pattern/bindings-after-at/wild-before-at-syntactically-rejected.stderr +++ b/tests/ui/pattern/bindings-after-at/wild-before-at-syntactically-rejected.stderr @@ -6,7 +6,11 @@ LL | let _ @ a = 0; | | | | | binding on the right, should be on the left | pattern on the left, should be on the right - | help: switch the order: `a @ _` + | +help: switch the order + | +LL | let a @ _ = 0; + | ~~~~~ error: pattern on wrong side of `@` --> $DIR/wild-before-at-syntactically-rejected.rs:10:9 @@ -16,7 +20,11 @@ LL | let _ @ ref a = 0; | | | | | binding on the right, should be on the left | pattern on the left, should be on the right - | help: switch the order: `ref a @ _` + | +help: switch the order + | +LL | let ref a @ _ = 0; + | ~~~~~~~~~ error: pattern on wrong side of `@` --> $DIR/wild-before-at-syntactically-rejected.rs:12:9 @@ -26,7 +34,11 @@ LL | let _ @ ref mut a = 0; | | | | | binding on the right, should be on the left | pattern on the left, should be on the right - | help: switch the order: `ref mut a @ _` + | +help: switch the order + | +LL | let ref mut a @ _ = 0; + | ~~~~~~~~~~~~~ error: left-hand side of `@` must be a binding --> $DIR/wild-before-at-syntactically-rejected.rs:14:9 diff --git a/tests/ui/pattern/issue-80186-mut-binding-help-suggestion.stderr b/tests/ui/pattern/issue-80186-mut-binding-help-suggestion.stderr index 167016397d2..622358126b0 100644 --- a/tests/ui/pattern/issue-80186-mut-binding-help-suggestion.stderr +++ b/tests/ui/pattern/issue-80186-mut-binding-help-suggestion.stderr @@ -2,9 +2,13 @@ error: `mut` must be attached to each individual binding --> $DIR/issue-80186-mut-binding-help-suggestion.rs:5:9 | LL | let mut &x = &0; - | ^^^^^^ help: add `mut` to each binding: `&(mut x)` + | ^^^^^^ | = note: `mut` may be followed by `variable` and `variable @ pattern` +help: add `mut` to each binding + | +LL | let &(mut x) = &0; + | ~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/pattern/pattern-bad-ref-box-order.stderr b/tests/ui/pattern/pattern-bad-ref-box-order.stderr index a49f05c1028..a89d3ed21b6 100644 --- a/tests/ui/pattern/pattern-bad-ref-box-order.stderr +++ b/tests/ui/pattern/pattern-bad-ref-box-order.stderr @@ -2,7 +2,12 @@ error: switch the order of `ref` and `box` --> $DIR/pattern-bad-ref-box-order.rs:8:14 | LL | Some(ref box _i) => {}, - | ^^^^^^^ help: swap them: `box ref` + | ^^^^^^^ + | +help: swap them + | +LL | Some(box ref _i) => {}, + | ~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/pattern/range-pattern-meant-to-be-slice-rest-pattern.stderr b/tests/ui/pattern/range-pattern-meant-to-be-slice-rest-pattern.stderr index 37c02eb6ada..9d642b9245a 100644 --- a/tests/ui/pattern/range-pattern-meant-to-be-slice-rest-pattern.stderr +++ b/tests/ui/pattern/range-pattern-meant-to-be-slice-rest-pattern.stderr @@ -2,7 +2,12 @@ error: range-to patterns with `...` are not allowed --> $DIR/range-pattern-meant-to-be-slice-rest-pattern.rs:17:13 | LL | [_, ...tail] => println!("{tail}"), - | ^^^ help: use `..=` instead + | ^^^ + | +help: use `..=` instead + | +LL | [_, ..=tail] => println!("{tail}"), + | ~~~ error[E0425]: cannot find value `rest` in this scope --> $DIR/range-pattern-meant-to-be-slice-rest-pattern.rs:3:13 |
