Skip to content

Commit 814e3af

Browse files
authored
Rollup merge of rust-lang#67786 - Centril:canon-span, r=petrochenkov
Nix reexports from `rustc_span` in `syntax` Remove reexports `syntax::{source_map, symbol, edition}` and use `rustc_span` paths directly. r? @petrochenkov
2 parents 93ff897 + 6e4ea14 commit 814e3af

File tree

235 files changed

+352
-356
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

235 files changed

+352
-356
lines changed

src/librustc/arena.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ macro_rules! arena_types {
9494
>
9595
>,
9696
[few] diagnostic_items: rustc_data_structures::fx::FxHashMap<
97-
syntax::symbol::Symbol,
97+
rustc_span::symbol::Symbol,
9898
rustc::hir::def_id::DefId,
9999
>,
100100
[few] resolve_lifetimes: rustc::middle::resolve_lifetime::ResolveLifetimes,
@@ -105,7 +105,7 @@ macro_rules! arena_types {
105105
[few] privacy_access_levels: rustc::middle::privacy::AccessLevels,
106106
[few] target_features_whitelist: rustc_data_structures::fx::FxHashMap<
107107
String,
108-
Option<syntax::symbol::Symbol>
108+
Option<rustc_span::symbol::Symbol>
109109
>,
110110
[few] wasm_import_module_map: rustc_data_structures::fx::FxHashMap<
111111
rustc::hir::def_id::DefId,

src/librustc/hir/check_attr.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ use crate::lint::builtin::UNUSED_ATTRIBUTES;
1212
use crate::ty::query::Providers;
1313
use crate::ty::TyCtxt;
1414

15+
use rustc_error_codes::*;
16+
use rustc_span::symbol::sym;
1517
use rustc_span::Span;
16-
use std::fmt::{self, Display};
17-
use syntax::{attr, symbol::sym};
18+
use syntax::attr;
1819

19-
use rustc_error_codes::*;
20+
use std::fmt::{self, Display};
2021

2122
#[derive(Copy, Clone, PartialEq)]
2223
pub(crate) enum MethodKind {

src/librustc/hir/map/collector.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ use crate::session::Session;
1111
use crate::util::nodemap::FxHashMap;
1212
use rustc_data_structures::svh::Svh;
1313
use rustc_index::vec::IndexVec;
14+
use rustc_span::source_map::SourceMap;
1415
use rustc_span::Span;
1516
use std::iter::repeat;
1617
use syntax::ast::NodeId;
17-
use syntax::source_map::SourceMap;
1818

1919
use crate::ich::StableHashingContext;
2020
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};

src/librustc/hir/map/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ use crate::util::nodemap::FxHashMap;
1717
use rustc_data_structures::svh::Svh;
1818
use rustc_index::vec::IndexVec;
1919
use rustc_span::hygiene::MacroKind;
20+
use rustc_span::source_map::Spanned;
2021
use rustc_span::{Span, DUMMY_SP};
2122
use rustc_target::spec::abi::Abi;
2223
use syntax::ast::{self, Name, NodeId};
23-
use syntax::source_map::Spanned;
2424

2525
pub mod blocks;
2626
mod collector;

src/librustc/hir/print.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1+
use rustc_span::source_map::{SourceMap, Spanned};
2+
use rustc_span::symbol::kw;
13
use rustc_span::{self, BytePos, FileName};
24
use rustc_target::spec::abi::Abi;
35
use syntax::ast;
46
use syntax::print::pp::Breaks::{Consistent, Inconsistent};
57
use syntax::print::pp::{self, Breaks};
68
use syntax::print::pprust::{self, Comments, PrintState};
79
use syntax::sess::ParseSess;
8-
use syntax::source_map::{SourceMap, Spanned};
9-
use syntax::symbol::kw;
1010
use syntax::util::parser::{self, AssocOp, Fixity};
1111

1212
use crate::hir;

src/librustc/ich/hcx.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ use crate::ty::{fast_reject, TyCtxt};
99

1010
use std::cmp::Ord;
1111

12+
use rustc_span::source_map::SourceMap;
13+
use rustc_span::symbol::Symbol;
1214
use rustc_span::{BytePos, SourceFile};
1315
use syntax::ast;
14-
use syntax::source_map::SourceMap;
15-
use syntax::symbol::Symbol;
1616

1717
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
1818
use rustc_data_structures::stable_hasher::{HashStable, StableHasher, ToStableHashKey};

src/librustc/ich/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ pub use self::hcx::{
44
hash_stable_trait_impls, NodeIdHashingMode, StableHashingContext, StableHashingContextProvider,
55
};
66
crate use rustc_data_structures::fingerprint::Fingerprint;
7+
use rustc_span::symbol::{sym, Symbol};
78
pub use rustc_span::CachingSourceMapView;
8-
use syntax::symbol::{sym, Symbol};
99

1010
mod hcx;
1111

src/librustc/infer/canonical/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ use crate::ty::{self, BoundVar, List, Region, TyCtxt};
3030
use rustc_index::vec::IndexVec;
3131
use rustc_macros::HashStable;
3232
use rustc_serialize::UseSpecializedDecodable;
33+
use rustc_span::source_map::Span;
3334
use smallvec::SmallVec;
3435
use std::ops::Index;
35-
use syntax::source_map::Span;
3636

3737
mod canonicalizer;
3838

src/librustc/infer/error_reporting/need_type_info.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ use crate::infer::InferCtxt;
66
use crate::ty::print::Print;
77
use crate::ty::{self, DefIdTree, Infer, Ty, TyVar};
88
use errors::{Applicability, DiagnosticBuilder};
9+
use rustc_span::source_map::DesugaringKind;
10+
use rustc_span::symbol::kw;
911
use rustc_span::Span;
1012
use std::borrow::Cow;
11-
use syntax::source_map::DesugaringKind;
12-
use syntax::symbol::kw;
1313

1414
use rustc_error_codes::*;
1515

src/librustc/infer/error_reporting/nice_region_error/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use crate::infer::InferCtxt;
44
use crate::ty::{self, TyCtxt};
55
use crate::util::common::ErrorReported;
66
use errors::DiagnosticBuilder;
7-
use syntax::source_map::Span;
7+
use rustc_span::source_map::Span;
88

99
mod different_lifetimes;
1010
mod find_anon_type;

src/librustc/infer/type_variable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::hir::def_id::DefId;
22
use crate::ty::{self, Ty, TyVid};
3+
use rustc_span::symbol::Symbol;
34
use rustc_span::Span;
4-
use syntax::symbol::Symbol;
55

66
use rustc_data_structures::snapshot_vec as sv;
77
use rustc_data_structures::unify as ut;

src/librustc/infer/unify_key.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use crate::ty::{self, FloatVarValue, InferConst, IntVarValue, Ty, TyCtxt};
22
use rustc_data_structures::unify::InPlace;
33
use rustc_data_structures::unify::{EqUnifyValue, NoError, UnificationTable, UnifyKey, UnifyValue};
4+
use rustc_span::symbol::Symbol;
45
use rustc_span::{Span, DUMMY_SP};
5-
use syntax::symbol::Symbol;
66

77
use std::cell::RefMut;
88
use std::cmp;

src/librustc/lint/builtin.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ use crate::middle::stability;
99
use crate::session::Session;
1010
use errors::{pluralize, Applicability, DiagnosticBuilder};
1111
use rustc_session::declare_lint;
12+
use rustc_span::edition::Edition;
13+
use rustc_span::source_map::Span;
14+
use rustc_span::symbol::Symbol;
1215
use syntax::ast;
1316
use syntax::early_buffered_lints::{ILL_FORMED_ATTRIBUTE_INPUT, META_VARIABLE_MISUSE};
14-
use syntax::edition::Edition;
15-
use syntax::source_map::Span;
16-
use syntax::symbol::Symbol;
1717

1818
declare_lint! {
1919
pub EXCEEDING_BITSHIFTS,

src/librustc/lint/internal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ use crate::lint::{
88
use errors::Applicability;
99
use rustc_data_structures::fx::FxHashMap;
1010
use rustc_session::declare_tool_lint;
11+
use rustc_span::symbol::{sym, Symbol};
1112
use syntax::ast::{Ident, Item, ItemKind};
12-
use syntax::symbol::{sym, Symbol};
1313

1414
declare_tool_lint! {
1515
pub rustc::DEFAULT_HASH_TYPES,

src/librustc/lint/levels.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ use crate::session::Session;
99
use crate::util::nodemap::FxHashMap;
1010
use errors::{Applicability, DiagnosticBuilder};
1111
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
12+
use rustc_span::source_map::MultiSpan;
13+
use rustc_span::symbol::{sym, Symbol};
1214
use syntax::ast;
1315
use syntax::attr;
1416
use syntax::feature_gate;
1517
use syntax::print::pprust;
16-
use syntax::source_map::MultiSpan;
17-
use syntax::symbol::{sym, Symbol};
1818

1919
use rustc_error_codes::*;
2020

src/librustc/lint/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ use crate::ty::TyCtxt;
3333
use crate::util::nodemap::NodeMap;
3434
use errors::{DiagnosticBuilder, DiagnosticId};
3535
use rustc_span::hygiene::MacroKind;
36+
use rustc_span::source_map::{DesugaringKind, ExpnKind, MultiSpan};
37+
use rustc_span::symbol::Symbol;
3638
use rustc_span::Span;
3739
use syntax::ast;
38-
use syntax::source_map::{DesugaringKind, ExpnKind, MultiSpan};
39-
use syntax::symbol::Symbol;
4040

4141
pub use crate::lint::context::{
4242
check_ast_crate, check_crate, late_lint_mod, BufferedEarlyLint, CheckLintNameResult,

src/librustc/middle/cstore.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ use rustc_data_structures::svh::Svh;
1212

1313
use rustc_data_structures::sync::{self, MetadataRef};
1414
use rustc_macros::HashStable;
15+
use rustc_span::symbol::Symbol;
1516
use rustc_span::Span;
1617
use rustc_target::spec::Target;
1718
use std::any::Any;
1819
use std::path::{Path, PathBuf};
1920
use syntax::ast;
2021
use syntax::expand::allocator::AllocatorKind;
21-
use syntax::symbol::Symbol;
2222

2323
pub use self::NativeLibraryKind::*;
2424
pub use rustc_session::utils::NativeLibraryKind;

src/librustc/middle/lang_items.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ use crate::util::nodemap::FxHashMap;
1919
use crate::hir;
2020
use crate::hir::itemlikevisit::ItemLikeVisitor;
2121
use rustc_macros::HashStable;
22+
use rustc_span::symbol::{sym, Symbol};
2223
use rustc_span::Span;
2324
use syntax::ast;
24-
use syntax::symbol::{sym, Symbol};
2525

2626
use rustc_error_codes::*;
2727

src/librustc/middle/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ pub mod free_region;
55
pub mod lang_items;
66
pub mod lib_features {
77
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
8-
use syntax::symbol::Symbol;
8+
use rustc_span::symbol::Symbol;
99

1010
#[derive(HashStable)]
1111
pub struct LibFeatures {

src/librustc/middle/recursion_limit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
// just peeks and looks for that attribute.
77

88
use crate::session::Session;
9+
use rustc_span::symbol::{sym, Symbol};
910
use syntax::ast;
10-
use syntax::symbol::{sym, Symbol};
1111

1212
use rustc_data_structures::sync::Once;
1313

src/librustc/middle/stability.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ use crate::ty::{self, TyCtxt};
1313
use crate::util::nodemap::{FxHashMap, FxHashSet};
1414
use errors::DiagnosticBuilder;
1515
use rustc_feature::GateIssue;
16+
use rustc_span::symbol::{sym, Symbol};
1617
use rustc_span::{MultiSpan, Span};
1718
use syntax::ast::CRATE_NODE_ID;
1819
use syntax::attr::{self, ConstStability, Deprecation, RustcDeprecation, Stability};
1920
use syntax::errors::Applicability;
2021
use syntax::feature_gate::feature_err_issue;
21-
use syntax::symbol::{sym, Symbol};
2222

2323
use std::num::NonZeroU32;
2424

src/librustc/middle/weak_lang_items.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ use crate::hir::intravisit;
99
use crate::hir::intravisit::{NestedVisitorMap, Visitor};
1010
use crate::ty::TyCtxt;
1111
use rustc_data_structures::fx::FxHashSet;
12+
use rustc_span::symbol::{sym, Symbol};
1213
use rustc_span::Span;
1314
use rustc_target::spec::PanicStrategy;
1415
use syntax::ast;
15-
use syntax::symbol::{sym, Symbol};
1616

1717
use rustc_error_codes::*;
1818

src/librustc/mir/interpret/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ use backtrace::Backtrace;
1111
use errors::DiagnosticBuilder;
1212
use hir::GeneratorKind;
1313
use rustc_macros::HashStable;
14+
use rustc_span::symbol::Symbol;
1415
use rustc_span::{Pos, Span};
1516
use rustc_target::spec::abi::Abi;
1617
use std::{any::Any, env, fmt};
17-
use syntax::symbol::Symbol;
1818

1919
use rustc_error_codes::*;
2020

src/librustc/mir/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ use rustc_index::bit_set::BitMatrix;
2727
use rustc_index::vec::{Idx, IndexVec};
2828
use rustc_macros::HashStable;
2929
use rustc_serialize::{Decodable, Encodable};
30+
use rustc_span::symbol::Symbol;
3031
use rustc_span::{Span, DUMMY_SP};
3132
use smallvec::SmallVec;
3233
use std::borrow::Cow;
@@ -36,7 +37,6 @@ use std::slice;
3637
use std::{iter, mem, option, u32};
3738
pub use syntax::ast::Mutability;
3839
use syntax::ast::Name;
39-
use syntax::symbol::Symbol;
4040

4141
pub use crate::mir::cache::{BodyAndCache, ReadOnlyBodyAndCache};
4242
pub use crate::mir::interpret::AssertMessage;

src/librustc/mir/mono.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ use crate::ty::{subst::InternalSubsts, Instance, InstanceDef, SymbolName, TyCtxt
88
use crate::util::nodemap::FxHashMap;
99
use rustc_data_structures::base_n;
1010
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
11+
use rustc_span::source_map::Span;
12+
use rustc_span::symbol::Symbol;
1113
use std::fmt;
1214
use std::hash::Hash;
1315
use syntax::attr::InlineAttr;
14-
use syntax::source_map::Span;
15-
use syntax::symbol::Symbol;
1616

1717
/// Describes how a monomorphization will be instantiated in object files.
1818
#[derive(PartialEq)]

src/librustc/traits/coherence.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ use crate::traits::{self, Normalized, Obligation, ObligationCause, SelectionCont
1212
use crate::ty::fold::TypeFoldable;
1313
use crate::ty::subst::Subst;
1414
use crate::ty::{self, Ty, TyCtxt};
15+
use rustc_span::symbol::sym;
1516
use rustc_span::DUMMY_SP;
16-
use syntax::symbol::sym;
1717

1818
/// Whether we do the orphan check relative to this crate or
1919
/// to some remote crate.

src/librustc/traits/error_reporting.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ use crate::util::nodemap::{FxHashMap, FxHashSet};
2626
use errors::{pluralize, Applicability, DiagnosticBuilder, Style};
2727
use rustc::hir::def_id::LOCAL_CRATE;
2828
use rustc_span::source_map::SourceMap;
29+
use rustc_span::symbol::{kw, sym};
2930
use rustc_span::{ExpnKind, MultiSpan, Span, DUMMY_SP};
3031
use std::fmt;
3132
use syntax::ast;
32-
use syntax::symbol::{kw, sym};
3333

3434
use rustc_error_codes::*;
3535

src/librustc/traits/object_safety.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ use crate::lint;
1616
use crate::traits::{self, Obligation, ObligationCause};
1717
use crate::ty::subst::{InternalSubsts, Subst};
1818
use crate::ty::{self, Predicate, ToPredicate, Ty, TyCtxt, TypeFoldable};
19+
use rustc_span::symbol::Symbol;
1920
use rustc_span::{Span, DUMMY_SP};
2021
use std::borrow::Cow;
2122
use std::iter::{self};
2223
use syntax::ast::{self};
23-
use syntax::symbol::Symbol;
2424

2525
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
2626
pub enum ObjectSafetyViolation {

src/librustc/traits/on_unimplemented.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ use crate::ty::{self, GenericParamDefKind, TyCtxt};
55
use crate::util::common::ErrorReported;
66
use crate::util::nodemap::FxHashMap;
77

8+
use rustc_span::symbol::{kw, sym, Symbol};
89
use rustc_span::Span;
910
use syntax::ast::{MetaItem, NestedMetaItem};
1011
use syntax::attr;
11-
use syntax::symbol::{kw, sym, Symbol};
1212

1313
use rustc_error_codes::*;
1414

src/librustc/traits/project.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ use crate::ty::{self, ToPolyTraitRef, ToPredicate, Ty, TyCtxt};
2121
use crate::util::common::FN_OUTPUT_NAME;
2222
use rustc_data_structures::snapshot_map::{Snapshot, SnapshotMap};
2323
use rustc_macros::HashStable;
24+
use rustc_span::symbol::sym;
2425
use rustc_span::DUMMY_SP;
2526
use syntax::ast::Ident;
26-
use syntax::symbol::sym;
2727

2828
/// Depending on the stage of compilation, we want projection to be
2929
/// more or less conservative.

src/librustc/traits/query/dropck_outlives.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ use crate::infer::canonical::OriginalQueryValues;
33
use crate::infer::InferOk;
44
use crate::ty::subst::GenericArg;
55
use crate::ty::{self, Ty, TyCtxt};
6+
use rustc_span::source_map::Span;
67
use std::iter::FromIterator;
7-
use syntax::source_map::Span;
88

99
use rustc_error_codes::*;
1010

src/librustc/traits/query/outlives_bounds.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use crate::infer::InferCtxt;
44
use crate::traits::query::NoSolution;
55
use crate::traits::{FulfillmentContext, ObligationCause, TraitEngine, TraitEngineExt};
66
use crate::ty::{self, Ty};
7-
use syntax::source_map::Span;
7+
use rustc_span::source_map::Span;
88

99
use crate::ich::StableHashingContext;
1010
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};

0 commit comments

Comments
 (0)