Skip to content

Commit

Permalink
cargo dev dogfood
Browse files Browse the repository at this point in the history
cargo uibless
  • Loading branch information
lengyijun committed Nov 13, 2024
1 parent 81bfb0c commit f62ebb0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions clippy_lints/src/use_crate_prefix_for_self_imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use clippy_utils::source::snippet_opt;
use def_id::LOCAL_CRATE;
use rustc_errors::Applicability;
use rustc_hir::def::Res;
use rustc_hir::*;
use rustc_hir::{Item, ItemKind, def_id};
use rustc_lint::{LateContext, LateLintPass, LintContext};
use rustc_session::declare_lint_pass;
use rustc_span::{FileName, RealFileName};
Expand Down Expand Up @@ -75,10 +75,10 @@ impl LateLintPass<'_> for UseCratePrefixForSelfImports {
span_lint_and_sugg(
cx,
USE_CRATE_PREFIX_FOR_SELF_IMPORTS,
use_path.span,
segment.ident.span,
"this import is not clear",
"prefix with `crate::`",
format!("crate::{}", snippet_opt(cx, use_path.span).unwrap()),
format!("crate::{}", snippet_opt(cx, segment.ident.span).unwrap()),
Applicability::MachineApplicable,
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ error: this import is not clear
--> src/main.rs:1:5
|
1 | use foo::Foo;
| ^^^^^^^^ help: prefix with `crate::`: `crate::foo::Foo`
| ^^^ help: prefix with `crate::`: `crate::foo`
|
= note: `-D clippy::use-crate-prefix-for-self-imports` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::use_crate_prefix_for_self_imports)]`
Expand Down

0 comments on commit f62ebb0

Please sign in to comment.