diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-06-19 15:37:31 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-06-19 19:12:00 +1000 |
| commit | aaa220e8757d1d2bb3a7b4742db9e289c8454dc2 (patch) | |
| tree | 2eec7d6fe436be5faf45bfe15110d4039c780d0e /tests/ui/parser/attribute | |
| parent | 802779f77ddaac18865e5e52e01c5e4d122e9090 (diff) | |
| download | rust-aaa220e8757d1d2bb3a7b4742db9e289c8454dc2.tar.gz rust-aaa220e8757d1d2bb3a7b4742db9e289c8454dc2.zip | |
Move `parse_or_use_outer_attributes` out of `parse_expr_prefix_range`.
This eliminates another `Option<AttrWrapper>` argument and changes one obscure error message.
Diffstat (limited to 'tests/ui/parser/attribute')
| -rw-r--r-- | tests/ui/parser/attribute/attr-stmt-expr-attr-bad.rs | 4 | ||||
| -rw-r--r-- | tests/ui/parser/attribute/attr-stmt-expr-attr-bad.stderr | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/tests/ui/parser/attribute/attr-stmt-expr-attr-bad.rs b/tests/ui/parser/attribute/attr-stmt-expr-attr-bad.rs index d1950087c4c..26761a1d254 100644 --- a/tests/ui/parser/attribute/attr-stmt-expr-attr-bad.rs +++ b/tests/ui/parser/attribute/attr-stmt-expr-attr-bad.rs @@ -28,9 +28,9 @@ fn main() {} #[cfg(FALSE)] fn e() { let _ = move || #![attr] {foo}; } //~^ ERROR an inner attribute is not permitted in this context #[cfg(FALSE)] fn e() { let _ = #[attr] ..#[attr] 0; } -//~^ ERROR expected expression, found `..` +//~^ ERROR attributes are not allowed on range expressions starting with `..` #[cfg(FALSE)] fn e() { let _ = #[attr] ..; } -//~^ ERROR expected expression, found `..` +//~^ ERROR attributes are not allowed on range expressions starting with `..` #[cfg(FALSE)] fn e() { let _ = #[attr] &#![attr] 0; } //~^ ERROR an inner attribute is not permitted in this context #[cfg(FALSE)] fn e() { let _ = #[attr] &mut #![attr] 0; } diff --git a/tests/ui/parser/attribute/attr-stmt-expr-attr-bad.stderr b/tests/ui/parser/attribute/attr-stmt-expr-attr-bad.stderr index e46c591080d..3593c5182ce 100644 --- a/tests/ui/parser/attribute/attr-stmt-expr-attr-bad.stderr +++ b/tests/ui/parser/attribute/attr-stmt-expr-attr-bad.stderr @@ -119,17 +119,17 @@ LL | #[cfg(FALSE)] fn e() { let _ = move || #![attr] {foo}; } = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files = note: outer attributes, like `#[test]`, annotate the item following them -error: expected expression, found `..` +error: attributes are not allowed on range expressions starting with `..` --> $DIR/attr-stmt-expr-attr-bad.rs:30:40 | LL | #[cfg(FALSE)] fn e() { let _ = #[attr] ..#[attr] 0; } - | ^^ expected expression + | ^^ -error: expected expression, found `..` +error: attributes are not allowed on range expressions starting with `..` --> $DIR/attr-stmt-expr-attr-bad.rs:32:40 | LL | #[cfg(FALSE)] fn e() { let _ = #[attr] ..; } - | ^^ expected expression + | ^^ error: an inner attribute is not permitted in this context --> $DIR/attr-stmt-expr-attr-bad.rs:34:41 |
