rust/tests/ui/parser/attribute/attr-stmt-expr-attr-bad.stderr
Esteban Küber 692bc344d5 Make parse error suggestions verbose and fix spans
Go over all structured parser suggestions and make them verbose style.

When suggesting to add or remove delimiters, turn them into multiple suggestion parts.
2024-07-12 03:02:57 +00:00

502 lines
22 KiB
Plaintext

error: expected expression, found `]`
--> $DIR/attr-stmt-expr-attr-bad.rs:3:40
|
LL | #[cfg(FALSE)] fn e() { let _ = [#[attr]]; }
| ^ expected expression
error: expected one of `!`, `.`, `::`, `;`, `?`, `else`, `{`, or an operator, found `#`
--> $DIR/attr-stmt-expr-attr-bad.rs:5:35
|
LL | #[cfg(FALSE)] fn e() { let _ = foo#[attr](); }
| ^ expected one of 8 possible tokens
error: an inner attribute is not permitted in this context
--> $DIR/attr-stmt-expr-attr-bad.rs:7:36
|
LL | #[cfg(FALSE)] fn e() { let _ = foo(#![attr]); }
| ^^^^^^^^
|
= 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: an inner attribute is not permitted in this context
--> $DIR/attr-stmt-expr-attr-bad.rs:7:36
|
LL | #[cfg(FALSE)] fn e() { let _ = foo(#![attr]); }
| ^^^^^^^^
|
= 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
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error: expected expression, found `)`
--> $DIR/attr-stmt-expr-attr-bad.rs:7:44
|
LL | #[cfg(FALSE)] fn e() { let _ = foo(#![attr]); }
| ^ expected expression
error: an inner attribute is not permitted in this context
--> $DIR/attr-stmt-expr-attr-bad.rs:11:38
|
LL | #[cfg(FALSE)] fn e() { let _ = x.foo(#![attr]); }
| ^^^^^^^^
|
= 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 `)`
--> $DIR/attr-stmt-expr-attr-bad.rs:11:46
|
LL | #[cfg(FALSE)] fn e() { let _ = x.foo(#![attr]); }
| ^ expected expression
error: an inner attribute is not permitted in this context
--> $DIR/attr-stmt-expr-attr-bad.rs:14:36
|
LL | #[cfg(FALSE)] fn e() { let _ = 0 + #![attr] 0; }
| ^^^^^^^^
|
= 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: an inner attribute is not permitted in this context
--> $DIR/attr-stmt-expr-attr-bad.rs:16:33
|
LL | #[cfg(FALSE)] fn e() { let _ = !#![attr] 0; }
| ^^^^^^^^
|
= 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: an inner attribute is not permitted in this context
--> $DIR/attr-stmt-expr-attr-bad.rs:18:33
|
LL | #[cfg(FALSE)] fn e() { let _ = -#![attr] 0; }
| ^^^^^^^^
|
= 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 one of `!`, `.`, `::`, `;`, `?`, `else`, `{`, or an operator, found `#`
--> $DIR/attr-stmt-expr-attr-bad.rs:20:34
|
LL | #[cfg(FALSE)] fn e() { let _ = x #![attr] as Y; }
| ^ expected one of 8 possible tokens
error: an inner attribute is not permitted in this context
--> $DIR/attr-stmt-expr-attr-bad.rs:22:35
|
LL | #[cfg(FALSE)] fn e() { let _ = || #![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: an inner attribute is not permitted in this context
--> $DIR/attr-stmt-expr-attr-bad.rs:24:40
|
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: an inner attribute is not permitted in this context
--> $DIR/attr-stmt-expr-attr-bad.rs:26:35
|
LL | #[cfg(FALSE)] fn e() { let _ = || #![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: an inner attribute is not permitted in this context
--> $DIR/attr-stmt-expr-attr-bad.rs:28:40
|
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: 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; }
| ^^
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] ..; }
| ^^
error: an inner attribute is not permitted in this context
--> $DIR/attr-stmt-expr-attr-bad.rs:34:41
|
LL | #[cfg(FALSE)] fn e() { let _ = #[attr] &#![attr] 0; }
| ^^^^^^^^
|
= 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: an inner attribute is not permitted in this context
--> $DIR/attr-stmt-expr-attr-bad.rs:36:45
|
LL | #[cfg(FALSE)] fn e() { let _ = #[attr] &mut #![attr] 0; }
| ^^^^^^^^
|
= 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: outer attributes are not allowed on `if` and `else` branches
--> $DIR/attr-stmt-expr-attr-bad.rs:38:37
|
LL | #[cfg(FALSE)] fn e() { let _ = if 0 #[attr] {}; }
| -- ^^^^^^^ -- the attributes are attached to this branch
| |
| the branch belongs to this `if`
|
help: remove the attributes
|
LL - #[cfg(FALSE)] fn e() { let _ = if 0 #[attr] {}; }
LL + #[cfg(FALSE)] fn e() { let _ = if 0 {}; }
|
error: an inner attribute is not permitted in this context
--> $DIR/attr-stmt-expr-attr-bad.rs:40:38
|
LL | #[cfg(FALSE)] fn e() { let _ = if 0 {#![attr]}; }
| ^^^^^^^^
|
= 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 one of `.`, `;`, `?`, `else`, or an operator, found `#`
--> $DIR/attr-stmt-expr-attr-bad.rs:42:40
|
LL | #[cfg(FALSE)] fn e() { let _ = if 0 {} #[attr] else {}; }
| ^ expected one of `.`, `;`, `?`, `else`, or an operator
error: outer attributes are not allowed on `if` and `else` branches
--> $DIR/attr-stmt-expr-attr-bad.rs:44:45
|
LL | #[cfg(FALSE)] fn e() { let _ = if 0 {} else #[attr] {}; }
| ---- ^^^^^^^ -- the attributes are attached to this branch
| |
| the branch belongs to this `else`
|
help: remove the attributes
|
LL - #[cfg(FALSE)] fn e() { let _ = if 0 {} else #[attr] {}; }
LL + #[cfg(FALSE)] fn e() { let _ = if 0 {} else {}; }
|
error: an inner attribute is not permitted in this context
--> $DIR/attr-stmt-expr-attr-bad.rs:46:46
|
LL | #[cfg(FALSE)] fn e() { let _ = if 0 {} else {#![attr]}; }
| ^^^^^^^^
|
= 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: outer attributes are not allowed on `if` and `else` branches
--> $DIR/attr-stmt-expr-attr-bad.rs:48:45
|
LL | #[cfg(FALSE)] fn e() { let _ = if 0 {} else #[attr] if 0 {}; }
| ---- ^^^^^^^ ------- the attributes are attached to this branch
| |
| the branch belongs to this `else`
|
help: remove the attributes
|
LL - #[cfg(FALSE)] fn e() { let _ = if 0 {} else #[attr] if 0 {}; }
LL + #[cfg(FALSE)] fn e() { let _ = if 0 {} else if 0 {}; }
|
error: outer attributes are not allowed on `if` and `else` branches
--> $DIR/attr-stmt-expr-attr-bad.rs:50:50
|
LL | #[cfg(FALSE)] fn e() { let _ = if 0 {} else if 0 #[attr] {}; }
| -- ^^^^^^^ -- the attributes are attached to this branch
| |
| the branch belongs to this `if`
|
help: remove the attributes
|
LL - #[cfg(FALSE)] fn e() { let _ = if 0 {} else if 0 #[attr] {}; }
LL + #[cfg(FALSE)] fn e() { let _ = if 0 {} else if 0 {}; }
|
error: an inner attribute is not permitted in this context
--> $DIR/attr-stmt-expr-attr-bad.rs:52:51
|
LL | #[cfg(FALSE)] fn e() { let _ = if 0 {} else if 0 {#![attr]}; }
| ^^^^^^^^
|
= 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: outer attributes are not allowed on `if` and `else` branches
--> $DIR/attr-stmt-expr-attr-bad.rs:54:45
|
LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 #[attr] {}; }
| -- ^^^^^^^ -- the attributes are attached to this branch
| |
| the branch belongs to this `if`
|
help: remove the attributes
|
LL - #[cfg(FALSE)] fn e() { let _ = if let _ = 0 #[attr] {}; }
LL + #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {}; }
|
error: an inner attribute is not permitted in this context
--> $DIR/attr-stmt-expr-attr-bad.rs:56:46
|
LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {#![attr]}; }
| ^^^^^^^^
|
= 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 one of `.`, `;`, `?`, `else`, or an operator, found `#`
--> $DIR/attr-stmt-expr-attr-bad.rs:58:48
|
LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} #[attr] else {}; }
| ^ expected one of `.`, `;`, `?`, `else`, or an operator
error: outer attributes are not allowed on `if` and `else` branches
--> $DIR/attr-stmt-expr-attr-bad.rs:60:53
|
LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else #[attr] {}; }
| ---- ^^^^^^^ -- the attributes are attached to this branch
| |
| the branch belongs to this `else`
|
help: remove the attributes
|
LL - #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else #[attr] {}; }
LL + #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else {}; }
|
error: an inner attribute is not permitted in this context
--> $DIR/attr-stmt-expr-attr-bad.rs:62:54
|
LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else {#![attr]}; }
| ^^^^^^^^
|
= 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: outer attributes are not allowed on `if` and `else` branches
--> $DIR/attr-stmt-expr-attr-bad.rs:64:53
|
LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else #[attr] if let _ = 0 {}; }
| ---- ^^^^^^^ --------------- the attributes are attached to this branch
| |
| the branch belongs to this `else`
|
help: remove the attributes
|
LL - #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else #[attr] if let _ = 0 {}; }
LL + #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else if let _ = 0 {}; }
|
error: outer attributes are not allowed on `if` and `else` branches
--> $DIR/attr-stmt-expr-attr-bad.rs:66:66
|
LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else if let _ = 0 #[attr] {}; }
| -- ^^^^^^^ -- the attributes are attached to this branch
| |
| the branch belongs to this `if`
|
help: remove the attributes
|
LL - #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else if let _ = 0 #[attr] {}; }
LL + #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else if let _ = 0 {}; }
|
error: an inner attribute is not permitted in this context
--> $DIR/attr-stmt-expr-attr-bad.rs:68:67
|
LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else if let _ = 0 {#![attr]}; }
| ^^^^^^^^
|
= 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: an inner attribute is not permitted following an outer attribute
--> $DIR/attr-stmt-expr-attr-bad.rs:71:32
|
LL | #[cfg(FALSE)] fn s() { #[attr] #![attr] let _ = 0; }
| ------- ^^^^^^^^ not permitted following an outer attribute
| |
| previous outer attribute
|
= 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: an inner attribute is not permitted following an outer attribute
--> $DIR/attr-stmt-expr-attr-bad.rs:73:32
|
LL | #[cfg(FALSE)] fn s() { #[attr] #![attr] 0; }
| ------- ^^^^^^^^ not permitted following an outer attribute
| |
| previous outer attribute
|
= 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: an inner attribute is not permitted following an outer attribute
--> $DIR/attr-stmt-expr-attr-bad.rs:75:32
|
LL | #[cfg(FALSE)] fn s() { #[attr] #![attr] foo!(); }
| ------- ^^^^^^^^ ------- the inner attribute doesn't annotate this item macro invocation
| | |
| | not permitted following an outer attribute
| previous outer attribute
|
= note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files
help: to annotate the item macro invocation, change the attribute from inner to outer style
|
LL - #[cfg(FALSE)] fn s() { #[attr] #![attr] foo!(); }
LL + #[cfg(FALSE)] fn s() { #[attr] #[attr] foo!(); }
|
error: an inner attribute is not permitted following an outer attribute
--> $DIR/attr-stmt-expr-attr-bad.rs:77:32
|
LL | #[cfg(FALSE)] fn s() { #[attr] #![attr] foo![]; }
| ------- ^^^^^^^^ ------- the inner attribute doesn't annotate this item macro invocation
| | |
| | not permitted following an outer attribute
| previous outer attribute
|
= note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files
help: to annotate the item macro invocation, change the attribute from inner to outer style
|
LL - #[cfg(FALSE)] fn s() { #[attr] #![attr] foo![]; }
LL + #[cfg(FALSE)] fn s() { #[attr] #[attr] foo![]; }
|
error: an inner attribute is not permitted following an outer attribute
--> $DIR/attr-stmt-expr-attr-bad.rs:79:32
|
LL | #[cfg(FALSE)] fn s() { #[attr] #![attr] foo!{}; }
| ------- ^^^^^^^^ ------ the inner attribute doesn't annotate this item macro invocation
| | |
| | not permitted following an outer attribute
| previous outer attribute
|
= note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files
help: to annotate the item macro invocation, change the attribute from inner to outer style
|
LL - #[cfg(FALSE)] fn s() { #[attr] #![attr] foo!{}; }
LL + #[cfg(FALSE)] fn s() { #[attr] #[attr] foo!{}; }
|
error[E0586]: inclusive range with no end
--> $DIR/attr-stmt-expr-attr-bad.rs:85:35
|
LL | #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] 10 => () } }
| ^^^
|
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
help: use `..` instead
|
LL - #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] 10 => () } }
LL + #[cfg(FALSE)] fn e() { match 0 { 0..#[attr] 10 => () } }
|
error: expected one of `=>`, `if`, or `|`, found `#`
--> $DIR/attr-stmt-expr-attr-bad.rs:85:38
|
LL | #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] 10 => () } }
| ^ expected one of `=>`, `if`, or `|`
error[E0586]: inclusive range with no end
--> $DIR/attr-stmt-expr-attr-bad.rs:88:35
|
LL | #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] -10 => () } }
| ^^^
|
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
help: use `..` instead
|
LL - #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] -10 => () } }
LL + #[cfg(FALSE)] fn e() { match 0 { 0..#[attr] -10 => () } }
|
error: expected one of `=>`, `if`, or `|`, found `#`
--> $DIR/attr-stmt-expr-attr-bad.rs:88:38
|
LL | #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] -10 => () } }
| ^ expected one of `=>`, `if`, or `|`
error: unexpected token: `#`
--> $DIR/attr-stmt-expr-attr-bad.rs:91:39
|
LL | #[cfg(FALSE)] fn e() { match 0 { 0..=-#[attr] 10 => () } }
| ^
error[E0586]: inclusive range with no end
--> $DIR/attr-stmt-expr-attr-bad.rs:93:35
|
LL | #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] FOO => () } }
| ^^^
|
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
help: use `..` instead
|
LL - #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] FOO => () } }
LL + #[cfg(FALSE)] fn e() { match 0 { 0..#[attr] FOO => () } }
|
error: expected one of `=>`, `if`, or `|`, found `#`
--> $DIR/attr-stmt-expr-attr-bad.rs:93:38
|
LL | #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] FOO => () } }
| ^ expected one of `=>`, `if`, or `|`
error: unexpected token: `#`
--> $DIR/attr-stmt-expr-attr-bad.rs:97:34
|
LL | #[cfg(FALSE)] fn e() { let _ = x.#![attr]foo(); }
| ^
error: expected one of `.`, `;`, `?`, `else`, or an operator, found `#`
--> $DIR/attr-stmt-expr-attr-bad.rs:97:34
|
LL | #[cfg(FALSE)] fn e() { let _ = x.#![attr]foo(); }
| ^ expected one of `.`, `;`, `?`, `else`, or an operator
error: unexpected token: `#`
--> $DIR/attr-stmt-expr-attr-bad.rs:100:34
|
LL | #[cfg(FALSE)] fn e() { let _ = x.#[attr]foo(); }
| ^
error: expected one of `.`, `;`, `?`, `else`, or an operator, found `#`
--> $DIR/attr-stmt-expr-attr-bad.rs:100:34
|
LL | #[cfg(FALSE)] fn e() { let _ = x.#[attr]foo(); }
| ^ expected one of `.`, `;`, `?`, `else`, or an operator
error: expected statement after outer attribute
--> $DIR/attr-stmt-expr-attr-bad.rs:105:37
|
LL | #[cfg(FALSE)] fn e() { { fn foo() { #[attr]; } } }
| ^^^^^^^
error: expected statement after outer attribute
--> $DIR/attr-stmt-expr-attr-bad.rs:107:37
|
LL | #[cfg(FALSE)] fn e() { { fn foo() { #[attr] } } }
| ^^^^^^^
error: aborting due to 53 previous errors
For more information about this error, try `rustc --explain E0586`.