mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 21:23:56 +00:00
Simplify use crate::rustc_foo::bar
occurrences.
They can just be written as `use rustc_foo::bar`, which is far more standard. (I didn't even know that a `crate::` prefix was valid.)
This commit is contained in:
parent
10913d27a1
commit
dc8a455a00
4 changed files with 4 additions and 7 deletions
|
@ -1,10 +1,9 @@
|
||||||
use crate::rustc_lint::LintContext;
|
|
||||||
use clippy_utils::diagnostics::span_lint_and_then;
|
use clippy_utils::diagnostics::span_lint_and_then;
|
||||||
use clippy_utils::macros::{is_panic, root_macro_call};
|
use clippy_utils::macros::{is_panic, root_macro_call};
|
||||||
use clippy_utils::{is_else_clause, is_parent_stmt, peel_blocks_with_stmt, span_extract_comment, sugg};
|
use clippy_utils::{is_else_clause, is_parent_stmt, peel_blocks_with_stmt, span_extract_comment, sugg};
|
||||||
use rustc_errors::Applicability;
|
use rustc_errors::Applicability;
|
||||||
use rustc_hir::{Expr, ExprKind, UnOp};
|
use rustc_hir::{Expr, ExprKind, UnOp};
|
||||||
use rustc_lint::{LateContext, LateLintPass};
|
use rustc_lint::{LateContext, LateLintPass, LintContext};
|
||||||
use rustc_session::declare_lint_pass;
|
use rustc_session::declare_lint_pass;
|
||||||
|
|
||||||
declare_clippy_lint! {
|
declare_clippy_lint! {
|
||||||
|
|
|
@ -9,10 +9,10 @@ use rustc_lint::LateContext;
|
||||||
use rustc_middle::mir::{FakeReadCause, Mutability};
|
use rustc_middle::mir::{FakeReadCause, Mutability};
|
||||||
use rustc_middle::ty::{self, BorrowKind};
|
use rustc_middle::ty::{self, BorrowKind};
|
||||||
use rustc_span::sym;
|
use rustc_span::sym;
|
||||||
|
use rustc_trait_selection::infer::TyCtxtInferExt;
|
||||||
|
|
||||||
use super::ITER_OVEREAGER_CLONED;
|
use super::ITER_OVEREAGER_CLONED;
|
||||||
use crate::redundant_clone::REDUNDANT_CLONE;
|
use crate::redundant_clone::REDUNDANT_CLONE;
|
||||||
use crate::rustc_trait_selection::infer::TyCtxtInferExt;
|
|
||||||
|
|
||||||
#[derive(Clone, Copy)]
|
#[derive(Clone, Copy)]
|
||||||
pub(super) enum Op<'a> {
|
pub(super) enum Op<'a> {
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
use crate::rustc_lint::LintContext;
|
|
||||||
use clippy_utils::diagnostics::{span_lint_and_then, span_lint_hir};
|
use clippy_utils::diagnostics::{span_lint_and_then, span_lint_hir};
|
||||||
use clippy_utils::get_parent_expr;
|
use clippy_utils::get_parent_expr;
|
||||||
use clippy_utils::sugg::Sugg;
|
use clippy_utils::sugg::Sugg;
|
||||||
|
@ -9,7 +8,7 @@ use rustc_hir::intravisit::{Visitor as HirVisitor, Visitor};
|
||||||
use rustc_hir::{
|
use rustc_hir::{
|
||||||
intravisit as hir_visit, ClosureKind, CoroutineDesugaring, CoroutineKind, CoroutineSource, ExprKind, Node,
|
intravisit as hir_visit, ClosureKind, CoroutineDesugaring, CoroutineKind, CoroutineSource, ExprKind, Node,
|
||||||
};
|
};
|
||||||
use rustc_lint::{LateContext, LateLintPass};
|
use rustc_lint::{LateContext, LateLintPass, LintContext};
|
||||||
use rustc_middle::hir::nested_filter;
|
use rustc_middle::hir::nested_filter;
|
||||||
use rustc_middle::lint::in_external_macro;
|
use rustc_middle::lint::in_external_macro;
|
||||||
use rustc_middle::ty;
|
use rustc_middle::ty;
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
use crate::rustc_lint::LintContext;
|
|
||||||
use clippy_utils::diagnostics::span_lint_and_sugg;
|
use clippy_utils::diagnostics::span_lint_and_sugg;
|
||||||
use clippy_utils::source::snippet_with_context;
|
use clippy_utils::source::snippet_with_context;
|
||||||
use rustc_errors::Applicability;
|
use rustc_errors::Applicability;
|
||||||
use rustc_hir::{Block, ExprKind};
|
use rustc_hir::{Block, ExprKind};
|
||||||
use rustc_lint::{LateContext, LateLintPass};
|
use rustc_lint::{LateContext, LateLintPass, LintContext};
|
||||||
use rustc_session::declare_lint_pass;
|
use rustc_session::declare_lint_pass;
|
||||||
use rustc_span::{ExpnKind, MacroKind, Span};
|
use rustc_span::{ExpnKind, MacroKind, Span};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue