-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unconditional check FRU expression, even if there are errors present
- Loading branch information
1 parent
d442c01
commit 1c81540
Showing
3 changed files
with
36 additions
and
0 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,10 @@ | ||
// compile-flags: -Zdrop-tracking | ||
// edition: 2021 | ||
|
||
fn main() {} | ||
|
||
async fn foo() { | ||
None { value: (), ..Default::default() }.await; | ||
//~^ ERROR `Option<_>` is not a future | ||
//~| ERROR variant `Option<_>::None` has no field named `value` | ||
} |
23 changes: 23 additions & 0 deletions
23
src/test/ui/async-await/drop-track-bad-field-in-fru.stderr
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,23 @@ | ||
error[E0559]: variant `Option<_>::None` has no field named `value` | ||
--> $DIR/drop-track-bad-field-in-fru.rs:7:12 | ||
| | ||
LL | None { value: (), ..Default::default() }.await; | ||
| ^^^^^ `Option<_>::None` does not have this field | ||
|
||
error[E0277]: `Option<_>` is not a future | ||
--> $DIR/drop-track-bad-field-in-fru.rs:7:45 | ||
| | ||
LL | None { value: (), ..Default::default() }.await; | ||
| ^^^^^^ | ||
| | | ||
| `Option<_>` is not a future | ||
| help: remove the `.await` | ||
| | ||
= help: the trait `Future` is not implemented for `Option<_>` | ||
= note: Option<_> must be a future or must implement `IntoFuture` to be awaited | ||
= note: required for `Option<_>` to implement `IntoFuture` | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
Some errors have detailed explanations: E0277, E0559. | ||
For more information about an error, try `rustc --explain E0277`. |