diff options
| author | Michael Goulet <michael@errs.io> | 2023-06-23 19:18:18 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2023-06-23 19:18:20 +0000 |
| commit | 2cc7782cfd85a2c4dc2fa566fae4d4e356976471 (patch) | |
| tree | ff4b7e9b097aed21ee8bdc70bf425821b2bb5c05 /tests | |
| parent | 04075b32021932e3e8f6ab55d519b3b3494b6ef9 (diff) | |
| download | rust-2cc7782cfd85a2c4dc2fa566fae4d4e356976471.tar.gz rust-2cc7782cfd85a2c4dc2fa566fae4d4e356976471.zip | |
Add suggestion for bad block fragment error
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/parser/bad-interpolated-block.stderr | 12 | ||||
| -rw-r--r-- | tests/ui/parser/labeled-no-colon-expr.stderr | 4 |
2 files changed, 16 insertions, 0 deletions
diff --git a/tests/ui/parser/bad-interpolated-block.stderr b/tests/ui/parser/bad-interpolated-block.stderr index 2a0999afdfa..651036c51c9 100644 --- a/tests/ui/parser/bad-interpolated-block.stderr +++ b/tests/ui/parser/bad-interpolated-block.stderr @@ -10,6 +10,10 @@ LL | m!({}); | ------ in this macro invocation | = note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info) +help: wrap this in another block + | +LL | 'lab: { $b }; + | + + error: cannot use a `block` macro fragment here --> $DIR/bad-interpolated-block.rs:6:16 @@ -23,6 +27,10 @@ LL | m!({}); | ------ in this macro invocation | = note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info) +help: wrap this in another block + | +LL | unsafe { $b }; + | + + error: cannot use a `block` macro fragment here --> $DIR/bad-interpolated-block.rs:7:23 @@ -34,6 +42,10 @@ LL | m!({}); | ------ in this macro invocation | = note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info) +help: wrap this in another block + | +LL | |x: u8| -> () { $b }; + | + + error: aborting due to 3 previous errors diff --git a/tests/ui/parser/labeled-no-colon-expr.stderr b/tests/ui/parser/labeled-no-colon-expr.stderr index 62288fe152d..4d61d9c1403 100644 --- a/tests/ui/parser/labeled-no-colon-expr.stderr +++ b/tests/ui/parser/labeled-no-colon-expr.stderr @@ -77,6 +77,10 @@ LL | m!({}); | ------ in this macro invocation | = note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info) +help: wrap this in another block + | +LL | 'l5 { $b }; + | + + error: labeled expression must be followed by `:` --> $DIR/labeled-no-colon-expr.rs:14:8 |
