-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyD-editionDiagnostics: An error or lint that should account for edition differences.Diagnostics: An error or lint that should account for edition differences.T-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:
# Cargo.toml
[package]
name = "no-edition-diagnostics"
version = "0.1.0"
# note the lack of edition = ""
[dependencies]
anyhow = "1"
// src/lib.rs
use anyhow::*;
The current output is:
error[E0432]: unresolved import `anyhow`
--> src/lib.rs:1:5
|
1 | use anyhow::*;
| ^^^^^^ maybe a missing crate `anyhow`?
Ideally the output should look like:
error[E0432]: unresolved import `anyhow`
--> src/lib.rs:1:5
|
1 | use anyhow::*;
| ^^^^^^ maybe a missing crate `anyhow`?
hint: try adding an `extern crate` or move to a newer Rust edition
Since the solution for this case is generally going to be one of those two.
PatchMixolydic, est31, jyn514, TaKO8Ki, mfornet and 2 more
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyD-editionDiagnostics: An error or lint that should account for edition differences.Diagnostics: An error or lint that should account for edition differences.T-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.