You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Incorrect imports suggestion for code inside tokio::main #86241
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.
Even fixing the async part won't be sufficient because the #[tokio::main] attribute is in the way, too. There is more discussion at #85312 (comment) and #85427 as to why that doesn't work.
Activity
ehuss commentedon Jun 12, 2021
Thanks for the report!
Even fixing the
asyncpart won't be sufficient because the#[tokio::main]attribute is in the way, too. There is more discussion at #85312 (comment) and #85427 as to why that doesn't work.pnkfelix commentedon Nov 16, 2021
(This is probably fixed by proposed PR #90941.)
Cerber-Ursi commentedon Jun 5, 2022
Just checked in playground - seems to be fixed for now, probably should be closed?
ehuss commentedon Jun 5, 2022
Yea, I'm going to close as resolved by #94584.