1
Fork 0

Spruce up the diagnostics of some early lints

This commit is contained in:
León Orell Valerian Liehr 2024-06-03 07:17:19 +02:00
parent 9f2d0b3490
commit b2949ff911
No known key found for this signature in database
GPG key ID: D17A07215F68E713
32 changed files with 83 additions and 51 deletions

View file

@ -512,8 +512,9 @@ declare_lint! {
/// This will produce:
///
/// ```text
/// error: external crate `regex` unused in `lint_example`: remove the dependency or add `use regex as _;`
/// error: extern crate `regex` is unused in crate `lint_example`
/// |
/// = help: remove the dependency or add `use regex as _;` to the crate root
/// note: the lint level is defined here
/// --> src/lib.rs:1:9
/// |
@ -2202,8 +2203,7 @@ declare_lint! {
}
declare_lint! {
/// The `macro_use_extern_crate` lint detects the use of the
/// [`macro_use` attribute].
/// The `macro_use_extern_crate` lint detects the use of the [`macro_use` attribute].
///
/// ### Example
///
@ -2221,12 +2221,13 @@ declare_lint! {
/// This will produce:
///
/// ```text
/// error: deprecated `#[macro_use]` attribute used to import macros should be replaced at use sites with a `use` item to import the macro instead
/// error: applying the `#[macro_use]` attribute to an `extern crate` item is deprecated
/// --> src/main.rs:3:1
/// |
/// 3 | #[macro_use]
/// | ^^^^^^^^^^^^
/// |
/// = help: remove it and import macros at use sites with a `use` item instead
/// note: the lint level is defined here
/// --> src/main.rs:1:9
/// |