-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Given the following code:
#[tokio::main]
async fn main() {
let _ = Duration::from_millis(97);
}
The current output is:
error[E0433]: failed to resolve: use of undeclared type `Duration`
--> src/main.rs:3:13
|
3 | let _ = Duration::from_millis(97);
| ^^^^^^^^ not found in this scope
|
help: consider importing one of these items
|
2 | async use chrono::Duration;
| ^^^^^^^^^^^^^^^^^^^^^
2 | async use core::time::Duration;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
2 | async use humantime::Duration;
| ^^^^^^^^^^^^^^^^^^^^^^^^
2 | async use instant::Duration;
| ^^^^^^^^^^^^^^^^^^^^^^
and 5 other candidates
Note the async use
bit, which is, obviously, invalid syntax.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.