forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix spans for bad await in inline const
- Loading branch information
1 parent
a76d2e1
commit f2c500b
Showing
5 changed files
with
26 additions
and
64 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
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 |
---|---|---|
@@ -1,37 +1,12 @@ | ||
error[E0728]: `await` is only allowed inside `async` functions and blocks | ||
--> $DIR/issue-70594.rs:4:12 | ||
| | ||
LL | async fn fun() { | ||
| --- this is not `async` | ||
LL | [1; ().await]; | ||
| ^^^^^ only allowed inside `async` functions and blocks | ||
| ---^^^^^ | ||
| | | | ||
| | only allowed inside `async` functions and blocks | ||
| this is not `async` | ||
|
||
error[E0744]: `.await` is not allowed in a `const` | ||
--> $DIR/issue-70594.rs:4:9 | ||
| | ||
LL | [1; ().await]; | ||
| ^^^^^^^^ | ||
|
||
error[E0744]: `.await` is not allowed in a `const` | ||
--> $DIR/issue-70594.rs:4:12 | ||
| | ||
LL | [1; ().await]; | ||
| ^^^^^ | ||
|
||
error[E0277]: `()` is not a future | ||
--> $DIR/issue-70594.rs:4:12 | ||
| | ||
LL | [1; ().await]; | ||
| -^^^^^ | ||
| || | ||
| |`()` is not a future | ||
| help: remove the `.await` | ||
| | ||
= help: the trait `Future` is not implemented for `()` | ||
= note: () must be a future or must implement `IntoFuture` to be awaited | ||
= note: required for `()` to implement `IntoFuture` | ||
|
||
error: aborting due to 4 previous errors | ||
error: aborting due to 1 previous error | ||
|
||
Some errors have detailed explanations: E0277, E0728, E0744. | ||
For more information about an error, try `rustc --explain E0277`. | ||
For more information about this error, try `rustc --explain E0728`. |
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