Skip to content

Strange async use ...; compiler suggestion #87613

Closed
@gamozolabs

Description

@gamozolabs

Really minor issue, but when building the following, I get a strange fix suggestion which seems incorrect:

#[tokio::main]
async fn main() {
    Command::new("git");
}
[package]
name = "replicate"
version = "0.1.0"
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
tokio = { version = "1", features = ["process", "rt-multi-thread", "macros"] }
   Compiling replicate v0.1.0 (/home/pleb/replicate)
error[E0433]: failed to resolve: use of undeclared type `Command`
 --> src/main.rs:3:5
  |
3 |     Command::new("git");
  |     ^^^^^^^ not found in this scope
  |
help: consider importing one of these items
  |
2 | async use std::process::Command;
  |       ^^^^^^^^^^^^^^^^^^^^^^^^^^
2 | async use tokio::process::Command;
  |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

For more information about this error, try `rustc --explain E0433`.
error: could not compile `replicate` due to previous error
pleb@gamey ~/replicate $ rustc --version
rustc 1.56.0-nightly (492723897 2021-07-29)
pleb@gamey ~/replicate $ rustup default
nightly-x86_64-unknown-linux-gnu (default)

The async use seems to be a bit strange for the suggestion. Nevertheless, have a wonderful day <3

Metadata

Metadata

Assignees

Labels

A-async-awaitArea: Async & AwaitA-diagnosticsArea: Messages for errors, warnings, and lintsA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`AsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.C-bugCategory: This is a bug.D-invalid-suggestionDiagnostics: A structured suggestion resulting in incorrect code.

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions