-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
df0295f
commit 5ff428c
Showing
5 changed files
with
110 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
fn bar() -> String { | ||
#[cfg] | ||
[1, 2, 3].iter() //~ ERROR expected `;`, found `#` | ||
#[feature] | ||
attr::fn bar() -> String { //~ ERROR expected identifier, found keyword `fn` | ||
//~^ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `->` | ||
//~| ERROR expected `;`, found `bar` | ||
#[attr] | ||
[1, 2, 3].iter().map().collect::<String>() | ||
#[attr] | ||
|
||
}() | ||
} | ||
|
||
fn main() { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
error: expected `;`, found `#` | ||
--> $DIR/issue-118530-ice.rs:3:21 | ||
| | ||
LL | #[cfg] | ||
| ------ only `;` terminated statements or tail expressions are allowed after this attribute | ||
LL | [1, 2, 3].iter() | ||
| ^ expected `;` here | ||
LL | #[feature] | ||
| - unexpected token | ||
| | ||
help: add `;` here | ||
| | ||
LL | [1, 2, 3].iter(); | ||
| + | ||
help: alternatively, consider surrounding the expression with a block | ||
| | ||
LL | { [1, 2, 3].iter() } | ||
| + + | ||
|
||
error: expected identifier, found keyword `fn` | ||
--> $DIR/issue-118530-ice.rs:5:11 | ||
| | ||
LL | attr::fn bar() -> String { | ||
| ^^ expected identifier, found keyword | ||
|
||
error: expected `;`, found `bar` | ||
--> $DIR/issue-118530-ice.rs:5:13 | ||
| | ||
LL | #[feature] | ||
| ---------- only `;` terminated statements or tail expressions are allowed after this attribute | ||
LL | attr::fn bar() -> String { | ||
| ^--- unexpected token | ||
| | | ||
| help: add `;` here | ||
|
||
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `->` | ||
--> $DIR/issue-118530-ice.rs:5:20 | ||
| | ||
LL | attr::fn bar() -> String { | ||
| ^^ expected one of `.`, `;`, `?`, `}`, or an operator | ||
|
||
error: aborting due to 4 previous errors | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
fn bar() -> String { | ||
#[cfg(feature = )] | ||
[1, 2, 3].iter().map().collect::<String>() //~ ERROR expected `;`, found `#` | ||
|
||
#[attr] //~ ERROR attributes on expressions are experimental [E0658] | ||
//~^ ERROR cannot find attribute `attr` in this scope | ||
String::new() | ||
} | ||
|
||
fn main() { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
error: expected `;`, found `#` | ||
--> $DIR/issue-118531-ice.rs:3:47 | ||
| | ||
LL | #[cfg(feature = )] | ||
| ------------------ only `;` terminated statements or tail expressions are allowed after this attribute | ||
LL | [1, 2, 3].iter().map().collect::<String>() | ||
| ^ expected `;` here | ||
LL | | ||
LL | #[attr] | ||
| - unexpected token | ||
| | ||
help: add `;` here | ||
| | ||
LL | [1, 2, 3].iter().map().collect::<String>(); | ||
| + | ||
help: alternatively, consider surrounding the expression with a block | ||
| | ||
LL | { [1, 2, 3].iter().map().collect::<String>() } | ||
| + + | ||
|
||
error[E0658]: attributes on expressions are experimental | ||
--> $DIR/issue-118531-ice.rs:5:5 | ||
| | ||
LL | #[attr] | ||
| ^^^^^^^ | ||
| | ||
= note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information | ||
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable | ||
|
||
error: cannot find attribute `attr` in this scope | ||
--> $DIR/issue-118531-ice.rs:5:7 | ||
| | ||
LL | #[attr] | ||
| ^^^^ | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0658`. |