Move Spanned.

It's defined in `rustc_span::source_map` which doesn't make any sense
because it has nothing to do with source maps. This commit moves it to
the crate root, a more sensible spot for something this basic.
This commit is contained in:
Nicholas Nethercote
2026-03-10 16:12:05 +11:00
parent c260a1fb50
commit f599afe624
32 changed files with 32 additions and 42 deletions
+1 -2
View File
@@ -6,8 +6,7 @@
use rustc_hir::{BinOpKind, Expr, ExprKind};
use rustc_lint::{LateContext, LateLintPass};
use rustc_session::declare_lint_pass;
use rustc_span::Span;
use rustc_span::source_map::Spanned;
use rustc_span::{Span, Spanned};
declare_clippy_lint! {
/// ### What it does
@@ -6,7 +6,7 @@
use rustc_errors::Applicability;
use rustc_hir::{Expr, ExprKind, GenericArg, Mutability, QPath, Ty, TyKind};
use rustc_lint::LateContext;
use rustc_span::source_map::Spanned;
use rustc_span::Spanned;
use super::MANUAL_DANGLING_PTR;
@@ -7,7 +7,7 @@
use rustc_hir::{BinOpKind, Expr, ExprKind, UnOp};
use rustc_lint::LateContext;
use rustc_span::SyntaxContext;
use rustc_span::source_map::Spanned;
use rustc_span::Spanned;
use super::SUBOPTIMAL_FLOPS;
@@ -6,7 +6,7 @@
use rustc_errors::Applicability;
use rustc_hir::{BinOpKind, Expr, ExprKind};
use rustc_lint::LateContext;
use rustc_span::source_map::Spanned;
use rustc_span::Spanned;
use super::IMPRECISE_FLOPS;
@@ -6,7 +6,7 @@
use rustc_errors::Applicability;
use rustc_hir::{BinOpKind, Expr, ExprKind, PathSegment};
use rustc_lint::LateContext;
use rustc_span::source_map::Spanned;
use rustc_span::Spanned;
use super::IMPRECISE_FLOPS;
@@ -4,7 +4,7 @@
use rustc_errors::Applicability;
use rustc_hir::{BinOpKind, Expr, ExprKind};
use rustc_lint::LateContext;
use rustc_span::source_map::Spanned;
use rustc_span::Spanned;
use super::IMPRECISE_FLOPS;
@@ -4,7 +4,7 @@
use rustc_errors::Applicability;
use rustc_hir::{BinOpKind, Expr, ExprKind, PathSegment};
use rustc_lint::LateContext;
use rustc_span::source_map::Spanned;
use rustc_span::Spanned;
use super::SUBOPTIMAL_FLOPS;
@@ -5,7 +5,7 @@
use rustc_errors::Applicability;
use rustc_hir::{BinOpKind, Expr, ExprKind, PathSegment};
use rustc_lint::LateContext;
use rustc_span::source_map::Spanned;
use rustc_span::Spanned;
use super::SUBOPTIMAL_FLOPS;
@@ -6,7 +6,7 @@
use rustc_errors::Applicability;
use rustc_hir::{BinOpKind, Expr, ExprKind, PathSegment};
use rustc_lint::LateContext;
use rustc_span::source_map::Spanned;
use rustc_span::Spanned;
use super::SUBOPTIMAL_FLOPS;
@@ -6,7 +6,7 @@
use rustc_errors::Applicability;
use rustc_hir::{BinOpKind, Expr, ExprKind};
use rustc_lint::LateContext;
use rustc_span::source_map::Spanned;
use rustc_span::Spanned;
use std::f32::consts as f32_consts;
use std::f64::consts as f64_consts;
+1 -2
View File
@@ -13,8 +13,7 @@
use rustc_lint::{LateContext, LateLintPass};
use rustc_middle::ty::{self, Ty};
use rustc_session::impl_lint_pass;
use rustc_span::source_map::Spanned;
use rustc_span::{Span, Symbol};
use rustc_span::{Span, Spanned, Symbol};
declare_clippy_lint! {
/// ### What it does
+1 -2
View File
@@ -13,8 +13,7 @@
use rustc_hir::def::Res;
use rustc_hir::{Expr, ExprKind, Pat};
use rustc_lint::LateContext;
use rustc_span::source_map::Spanned;
use rustc_span::sym;
use rustc_span::{Spanned, sym};
use super::MANUAL_SLICE_FILL;
+1 -1
View File
@@ -8,7 +8,7 @@
use rustc_lint::LateContext;
use rustc_middle::hir::nested_filter;
use rustc_middle::ty::{self, Ty};
use rustc_span::source_map::Spanned;
use rustc_span::Spanned;
use rustc_span::symbol::{Symbol, sym};
#[derive(Debug, PartialEq, Eq)]
+1 -2
View File
@@ -15,8 +15,7 @@
use rustc_lint::{LateContext, LateLintPass, LintContext as _};
use rustc_middle::ty;
use rustc_session::impl_lint_pass;
use rustc_span::source_map::Spanned;
use rustc_span::{Symbol, SyntaxContext};
use rustc_span::{Spanned, Symbol, SyntaxContext};
use std::iter;
declare_clippy_lint! {
@@ -10,7 +10,7 @@
use rustc_hir::{Arm, BorrowKind, Expr, ExprKind, Pat, PatKind, QPath};
use rustc_lint::{LateContext, LintContext};
use rustc_middle::ty;
use rustc_span::source_map::Spanned;
use rustc_span::Spanned;
use super::MATCH_LIKE_MATCHES_MACRO;
@@ -8,7 +8,7 @@
use rustc_hir::{Expr, ExprKind, LangItem};
use rustc_lint::LateContext;
use rustc_span::Span;
use rustc_span::source_map::Spanned;
use rustc_span::Spanned;
use super::CASE_SENSITIVE_FILE_EXTENSION_COMPARISONS;
+1 -1
View File
@@ -7,7 +7,7 @@
use rustc_errors::Applicability;
use rustc_hir as hir;
use rustc_lint::LateContext;
use rustc_span::source_map::Spanned;
use rustc_span::Spanned;
use super::GET_FIRST;
@@ -5,7 +5,7 @@
use rustc_hir::{BinOpKind, Expr, ExprKind};
use rustc_lint::LateContext;
use rustc_middle::ty;
use rustc_span::source_map::Spanned;
use rustc_span::Spanned;
use super::GET_LAST_WITH_LEN;
+1 -1
View File
@@ -9,7 +9,7 @@
use rustc_hir::{BinOpKind, Body, Expr, ExprKind, HirId, QPath};
use rustc_lint::LateContext;
use rustc_middle::ty;
use rustc_span::source_map::Spanned;
use rustc_span::Spanned;
use super::MANUAL_CONTAINS;
+1 -1
View File
@@ -8,7 +8,7 @@
use rustc_lint::LateContext;
use rustc_middle::ty::Ty;
use rustc_span::Span;
use rustc_span::source_map::Spanned;
use rustc_span::Spanned;
use super::{NONSENSICAL_OPEN_OPTIONS, SUSPICIOUS_OPEN_OPTIONS};
@@ -3,7 +3,7 @@
use rustc_hir::{Expr, ExprKind};
use rustc_lint::LateContext;
use rustc_span::Symbol;
use rustc_span::source_map::Spanned;
use rustc_span::Spanned;
use super::SUSPICIOUS_SPLITN;
@@ -5,8 +5,7 @@
use rustc_errors::Applicability;
use rustc_hir::{Expr, ExprKind};
use rustc_lint::LateContext;
use rustc_span::source_map::Spanned;
use rustc_span::{Span, sym};
use rustc_span::{Span, Spanned, sym};
use super::VEC_RESIZE_TO_ZERO;
@@ -15,8 +15,7 @@
use rustc_hir::{Block, Body, Expr, ExprKind, UnOp};
use rustc_lint::{LateContext, LateLintPass};
use rustc_session::declare_lint_pass;
use rustc_span::source_map::Spanned;
use rustc_span::{Span, Symbol, sym};
use rustc_span::{Span, Spanned, Symbol, sym};
declare_clippy_lint! {
/// ### What it does
@@ -7,8 +7,7 @@
use rustc_lint::LateContext;
use rustc_middle::ty::layout::HasTyCtxt;
use rustc_middle::ty::{Ty, TypeckResults};
use rustc_span::Span;
use rustc_span::source_map::Spanned;
use rustc_span::{Span, Spanned};
use clippy_utils::SpanlessEq;
use clippy_utils::diagnostics::span_lint_and_note;
@@ -6,7 +6,7 @@
use rustc_hir::{BinOpKind, Expr, ExprKind};
use rustc_lint::LateContext;
use rustc_middle::ty;
use rustc_span::source_map::Spanned;
use rustc_span::Spanned;
use super::FLOAT_EQUALITY_WITHOUT_ABS;
@@ -9,7 +9,7 @@
use rustc_hir::{Expr, ExprKind};
use rustc_lint::LateContext;
use rustc_middle::ty::{self, Ty};
use rustc_span::source_map::Spanned;
use rustc_span::Spanned;
use super::MANUAL_DIV_CEIL;
+1 -1
View File
@@ -5,7 +5,7 @@
use rustc_errors::Applicability;
use rustc_lint::{EarlyContext, EarlyLintPass, Lint};
use rustc_session::declare_lint_pass;
use rustc_span::source_map::Spanned;
use rustc_span::Spanned;
declare_clippy_lint! {
/// ### What it does
+1 -2
View File
@@ -14,8 +14,7 @@
use rustc_lint::{LateContext, LateLintPass, Lint};
use rustc_middle::ty::{self, ClauseKind, GenericArgKind, PredicatePolarity, Ty};
use rustc_session::impl_lint_pass;
use rustc_span::source_map::Spanned;
use rustc_span::{DesugaringKind, Span};
use rustc_span::{DesugaringKind, Span, Spanned};
use std::cmp::Ordering;
declare_clippy_lint! {
+1 -1
View File
@@ -11,7 +11,7 @@
use rustc_lint::{LateContext, LateLintPass, LintContext};
use rustc_middle::ty;
use rustc_session::declare_lint_pass;
use rustc_span::source_map::Spanned;
use rustc_span::Spanned;
declare_clippy_lint! {
/// ### What it does
@@ -8,7 +8,7 @@
use rustc_lint::{EarlyContext, EarlyLintPass};
use rustc_session::declare_lint_pass;
use rustc_span::Span;
use rustc_span::source_map::Spanned;
use rustc_span::Spanned;
use rustc_span::symbol::Ident;
declare_clippy_lint! {
+1 -2
View File
@@ -14,9 +14,8 @@
use rustc_lint::{LateContext, LateLintPass, LintContext};
use rustc_middle::ty;
use rustc_session::declare_lint_pass;
use rustc_span::source_map::Spanned;
use rustc_span::symbol::Ident;
use rustc_span::{Span, SyntaxContext};
use rustc_span::{Span, Spanned, SyntaxContext};
declare_clippy_lint! {
/// ### What it does
@@ -12,9 +12,8 @@
use rustc_lint::{LateContext, LateLintPass};
use rustc_middle::hir::nested_filter;
use rustc_session::{declare_tool_lint, impl_lint_pass};
use rustc_span::Span;
use rustc_span::source_map::Spanned;
use rustc_span::symbol::Symbol;
use rustc_span::{Span, Spanned};
declare_tool_lint! {
/// ### What it does