Skip to content

Commit

Permalink
Rollup merge of rust-lang#67786 - Centril:canon-span, r=petrochenkov
Browse files Browse the repository at this point in the history
Nix reexports from `rustc_span` in `syntax`

Remove reexports `syntax::{source_map, symbol, edition}` and use `rustc_span` paths directly.

r? @petrochenkov
  • Loading branch information
Centril authored Jan 4, 2020
2 parents 93ff897 + 6e4ea14 commit 814e3af
Show file tree
Hide file tree
Showing 235 changed files with 352 additions and 356 deletions.
4 changes: 2 additions & 2 deletions src/librustc/arena.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ macro_rules! arena_types {
>
>,
[few] diagnostic_items: rustc_data_structures::fx::FxHashMap<
syntax::symbol::Symbol,
rustc_span::symbol::Symbol,
rustc::hir::def_id::DefId,
>,
[few] resolve_lifetimes: rustc::middle::resolve_lifetime::ResolveLifetimes,
Expand All @@ -105,7 +105,7 @@ macro_rules! arena_types {
[few] privacy_access_levels: rustc::middle::privacy::AccessLevels,
[few] target_features_whitelist: rustc_data_structures::fx::FxHashMap<
String,
Option<syntax::symbol::Symbol>
Option<rustc_span::symbol::Symbol>
>,
[few] wasm_import_module_map: rustc_data_structures::fx::FxHashMap<
rustc::hir::def_id::DefId,
Expand Down
7 changes: 4 additions & 3 deletions src/librustc/hir/check_attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ use crate::lint::builtin::UNUSED_ATTRIBUTES;
use crate::ty::query::Providers;
use crate::ty::TyCtxt;

use rustc_error_codes::*;
use rustc_span::symbol::sym;
use rustc_span::Span;
use std::fmt::{self, Display};
use syntax::{attr, symbol::sym};
use syntax::attr;

use rustc_error_codes::*;
use std::fmt::{self, Display};

#[derive(Copy, Clone, PartialEq)]
pub(crate) enum MethodKind {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/hir/map/collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ use crate::session::Session;
use crate::util::nodemap::FxHashMap;
use rustc_data_structures::svh::Svh;
use rustc_index::vec::IndexVec;
use rustc_span::source_map::SourceMap;
use rustc_span::Span;
use std::iter::repeat;
use syntax::ast::NodeId;
use syntax::source_map::SourceMap;

use crate::ich::StableHashingContext;
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/hir/map/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ use crate::util::nodemap::FxHashMap;
use rustc_data_structures::svh::Svh;
use rustc_index::vec::IndexVec;
use rustc_span::hygiene::MacroKind;
use rustc_span::source_map::Spanned;
use rustc_span::{Span, DUMMY_SP};
use rustc_target::spec::abi::Abi;
use syntax::ast::{self, Name, NodeId};
use syntax::source_map::Spanned;

pub mod blocks;
mod collector;
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/hir/print.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
use rustc_span::source_map::{SourceMap, Spanned};
use rustc_span::symbol::kw;
use rustc_span::{self, BytePos, FileName};
use rustc_target::spec::abi::Abi;
use syntax::ast;
use syntax::print::pp::Breaks::{Consistent, Inconsistent};
use syntax::print::pp::{self, Breaks};
use syntax::print::pprust::{self, Comments, PrintState};
use syntax::sess::ParseSess;
use syntax::source_map::{SourceMap, Spanned};
use syntax::symbol::kw;
use syntax::util::parser::{self, AssocOp, Fixity};

use crate::hir;
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/ich/hcx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ use crate::ty::{fast_reject, TyCtxt};

use std::cmp::Ord;

use rustc_span::source_map::SourceMap;
use rustc_span::symbol::Symbol;
use rustc_span::{BytePos, SourceFile};
use syntax::ast;
use syntax::source_map::SourceMap;
use syntax::symbol::Symbol;

use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_data_structures::stable_hasher::{HashStable, StableHasher, ToStableHashKey};
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/ich/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ pub use self::hcx::{
hash_stable_trait_impls, NodeIdHashingMode, StableHashingContext, StableHashingContextProvider,
};
crate use rustc_data_structures::fingerprint::Fingerprint;
use rustc_span::symbol::{sym, Symbol};
pub use rustc_span::CachingSourceMapView;
use syntax::symbol::{sym, Symbol};

mod hcx;

Expand Down
2 changes: 1 addition & 1 deletion src/librustc/infer/canonical/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ use crate::ty::{self, BoundVar, List, Region, TyCtxt};
use rustc_index::vec::IndexVec;
use rustc_macros::HashStable;
use rustc_serialize::UseSpecializedDecodable;
use rustc_span::source_map::Span;
use smallvec::SmallVec;
use std::ops::Index;
use syntax::source_map::Span;

mod canonicalizer;

Expand Down
4 changes: 2 additions & 2 deletions src/librustc/infer/error_reporting/need_type_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ use crate::infer::InferCtxt;
use crate::ty::print::Print;
use crate::ty::{self, DefIdTree, Infer, Ty, TyVar};
use errors::{Applicability, DiagnosticBuilder};
use rustc_span::source_map::DesugaringKind;
use rustc_span::symbol::kw;
use rustc_span::Span;
use std::borrow::Cow;
use syntax::source_map::DesugaringKind;
use syntax::symbol::kw;

use rustc_error_codes::*;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::infer::InferCtxt;
use crate::ty::{self, TyCtxt};
use crate::util::common::ErrorReported;
use errors::DiagnosticBuilder;
use syntax::source_map::Span;
use rustc_span::source_map::Span;

mod different_lifetimes;
mod find_anon_type;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/infer/type_variable.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::hir::def_id::DefId;
use crate::ty::{self, Ty, TyVid};
use rustc_span::symbol::Symbol;
use rustc_span::Span;
use syntax::symbol::Symbol;

use rustc_data_structures::snapshot_vec as sv;
use rustc_data_structures::unify as ut;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/infer/unify_key.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use crate::ty::{self, FloatVarValue, InferConst, IntVarValue, Ty, TyCtxt};
use rustc_data_structures::unify::InPlace;
use rustc_data_structures::unify::{EqUnifyValue, NoError, UnificationTable, UnifyKey, UnifyValue};
use rustc_span::symbol::Symbol;
use rustc_span::{Span, DUMMY_SP};
use syntax::symbol::Symbol;

use std::cell::RefMut;
use std::cmp;
Expand Down
6 changes: 3 additions & 3 deletions src/librustc/lint/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ use crate::middle::stability;
use crate::session::Session;
use errors::{pluralize, Applicability, DiagnosticBuilder};
use rustc_session::declare_lint;
use rustc_span::edition::Edition;
use rustc_span::source_map::Span;
use rustc_span::symbol::Symbol;
use syntax::ast;
use syntax::early_buffered_lints::{ILL_FORMED_ATTRIBUTE_INPUT, META_VARIABLE_MISUSE};
use syntax::edition::Edition;
use syntax::source_map::Span;
use syntax::symbol::Symbol;

declare_lint! {
pub EXCEEDING_BITSHIFTS,
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/lint/internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ use crate::lint::{
use errors::Applicability;
use rustc_data_structures::fx::FxHashMap;
use rustc_session::declare_tool_lint;
use rustc_span::symbol::{sym, Symbol};
use syntax::ast::{Ident, Item, ItemKind};
use syntax::symbol::{sym, Symbol};

declare_tool_lint! {
pub rustc::DEFAULT_HASH_TYPES,
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/lint/levels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ use crate::session::Session;
use crate::util::nodemap::FxHashMap;
use errors::{Applicability, DiagnosticBuilder};
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_span::source_map::MultiSpan;
use rustc_span::symbol::{sym, Symbol};
use syntax::ast;
use syntax::attr;
use syntax::feature_gate;
use syntax::print::pprust;
use syntax::source_map::MultiSpan;
use syntax::symbol::{sym, Symbol};

use rustc_error_codes::*;

Expand Down
4 changes: 2 additions & 2 deletions src/librustc/lint/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ use crate::ty::TyCtxt;
use crate::util::nodemap::NodeMap;
use errors::{DiagnosticBuilder, DiagnosticId};
use rustc_span::hygiene::MacroKind;
use rustc_span::source_map::{DesugaringKind, ExpnKind, MultiSpan};
use rustc_span::symbol::Symbol;
use rustc_span::Span;
use syntax::ast;
use syntax::source_map::{DesugaringKind, ExpnKind, MultiSpan};
use syntax::symbol::Symbol;

pub use crate::lint::context::{
check_ast_crate, check_crate, late_lint_mod, BufferedEarlyLint, CheckLintNameResult,
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/cstore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ use rustc_data_structures::svh::Svh;

use rustc_data_structures::sync::{self, MetadataRef};
use rustc_macros::HashStable;
use rustc_span::symbol::Symbol;
use rustc_span::Span;
use rustc_target::spec::Target;
use std::any::Any;
use std::path::{Path, PathBuf};
use syntax::ast;
use syntax::expand::allocator::AllocatorKind;
use syntax::symbol::Symbol;

pub use self::NativeLibraryKind::*;
pub use rustc_session::utils::NativeLibraryKind;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/lang_items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ use crate::util::nodemap::FxHashMap;
use crate::hir;
use crate::hir::itemlikevisit::ItemLikeVisitor;
use rustc_macros::HashStable;
use rustc_span::symbol::{sym, Symbol};
use rustc_span::Span;
use syntax::ast;
use syntax::symbol::{sym, Symbol};

use rustc_error_codes::*;

Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pub mod free_region;
pub mod lang_items;
pub mod lib_features {
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use syntax::symbol::Symbol;
use rustc_span::symbol::Symbol;

#[derive(HashStable)]
pub struct LibFeatures {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/recursion_limit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
// just peeks and looks for that attribute.

use crate::session::Session;
use rustc_span::symbol::{sym, Symbol};
use syntax::ast;
use syntax::symbol::{sym, Symbol};

use rustc_data_structures::sync::Once;

Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/stability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ use crate::ty::{self, TyCtxt};
use crate::util::nodemap::{FxHashMap, FxHashSet};
use errors::DiagnosticBuilder;
use rustc_feature::GateIssue;
use rustc_span::symbol::{sym, Symbol};
use rustc_span::{MultiSpan, Span};
use syntax::ast::CRATE_NODE_ID;
use syntax::attr::{self, ConstStability, Deprecation, RustcDeprecation, Stability};
use syntax::errors::Applicability;
use syntax::feature_gate::feature_err_issue;
use syntax::symbol::{sym, Symbol};

use std::num::NonZeroU32;

Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/weak_lang_items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ use crate::hir::intravisit;
use crate::hir::intravisit::{NestedVisitorMap, Visitor};
use crate::ty::TyCtxt;
use rustc_data_structures::fx::FxHashSet;
use rustc_span::symbol::{sym, Symbol};
use rustc_span::Span;
use rustc_target::spec::PanicStrategy;
use syntax::ast;
use syntax::symbol::{sym, Symbol};

use rustc_error_codes::*;

Expand Down
2 changes: 1 addition & 1 deletion src/librustc/mir/interpret/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ use backtrace::Backtrace;
use errors::DiagnosticBuilder;
use hir::GeneratorKind;
use rustc_macros::HashStable;
use rustc_span::symbol::Symbol;
use rustc_span::{Pos, Span};
use rustc_target::spec::abi::Abi;
use std::{any::Any, env, fmt};
use syntax::symbol::Symbol;

use rustc_error_codes::*;

Expand Down
2 changes: 1 addition & 1 deletion src/librustc/mir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ use rustc_index::bit_set::BitMatrix;
use rustc_index::vec::{Idx, IndexVec};
use rustc_macros::HashStable;
use rustc_serialize::{Decodable, Encodable};
use rustc_span::symbol::Symbol;
use rustc_span::{Span, DUMMY_SP};
use smallvec::SmallVec;
use std::borrow::Cow;
Expand All @@ -36,7 +37,6 @@ use std::slice;
use std::{iter, mem, option, u32};
pub use syntax::ast::Mutability;
use syntax::ast::Name;
use syntax::symbol::Symbol;

pub use crate::mir::cache::{BodyAndCache, ReadOnlyBodyAndCache};
pub use crate::mir::interpret::AssertMessage;
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/mir/mono.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ use crate::ty::{subst::InternalSubsts, Instance, InstanceDef, SymbolName, TyCtxt
use crate::util::nodemap::FxHashMap;
use rustc_data_structures::base_n;
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_span::source_map::Span;
use rustc_span::symbol::Symbol;
use std::fmt;
use std::hash::Hash;
use syntax::attr::InlineAttr;
use syntax::source_map::Span;
use syntax::symbol::Symbol;

/// Describes how a monomorphization will be instantiated in object files.
#[derive(PartialEq)]
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/traits/coherence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ use crate::traits::{self, Normalized, Obligation, ObligationCause, SelectionCont
use crate::ty::fold::TypeFoldable;
use crate::ty::subst::Subst;
use crate::ty::{self, Ty, TyCtxt};
use rustc_span::symbol::sym;
use rustc_span::DUMMY_SP;
use syntax::symbol::sym;

/// Whether we do the orphan check relative to this crate or
/// to some remote crate.
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/traits/error_reporting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ use crate::util::nodemap::{FxHashMap, FxHashSet};
use errors::{pluralize, Applicability, DiagnosticBuilder, Style};
use rustc::hir::def_id::LOCAL_CRATE;
use rustc_span::source_map::SourceMap;
use rustc_span::symbol::{kw, sym};
use rustc_span::{ExpnKind, MultiSpan, Span, DUMMY_SP};
use std::fmt;
use syntax::ast;
use syntax::symbol::{kw, sym};

use rustc_error_codes::*;

Expand Down
2 changes: 1 addition & 1 deletion src/librustc/traits/object_safety.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ use crate::lint;
use crate::traits::{self, Obligation, ObligationCause};
use crate::ty::subst::{InternalSubsts, Subst};
use crate::ty::{self, Predicate, ToPredicate, Ty, TyCtxt, TypeFoldable};
use rustc_span::symbol::Symbol;
use rustc_span::{Span, DUMMY_SP};
use std::borrow::Cow;
use std::iter::{self};
use syntax::ast::{self};
use syntax::symbol::Symbol;

#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
pub enum ObjectSafetyViolation {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/traits/on_unimplemented.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ use crate::ty::{self, GenericParamDefKind, TyCtxt};
use crate::util::common::ErrorReported;
use crate::util::nodemap::FxHashMap;

use rustc_span::symbol::{kw, sym, Symbol};
use rustc_span::Span;
use syntax::ast::{MetaItem, NestedMetaItem};
use syntax::attr;
use syntax::symbol::{kw, sym, Symbol};

use rustc_error_codes::*;

Expand Down
2 changes: 1 addition & 1 deletion src/librustc/traits/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ use crate::ty::{self, ToPolyTraitRef, ToPredicate, Ty, TyCtxt};
use crate::util::common::FN_OUTPUT_NAME;
use rustc_data_structures::snapshot_map::{Snapshot, SnapshotMap};
use rustc_macros::HashStable;
use rustc_span::symbol::sym;
use rustc_span::DUMMY_SP;
use syntax::ast::Ident;
use syntax::symbol::sym;

/// Depending on the stage of compilation, we want projection to be
/// more or less conservative.
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/traits/query/dropck_outlives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use crate::infer::canonical::OriginalQueryValues;
use crate::infer::InferOk;
use crate::ty::subst::GenericArg;
use crate::ty::{self, Ty, TyCtxt};
use rustc_span::source_map::Span;
use std::iter::FromIterator;
use syntax::source_map::Span;

use rustc_error_codes::*;

Expand Down
2 changes: 1 addition & 1 deletion src/librustc/traits/query/outlives_bounds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::infer::InferCtxt;
use crate::traits::query::NoSolution;
use crate::traits::{FulfillmentContext, ObligationCause, TraitEngine, TraitEngineExt};
use crate::ty::{self, Ty};
use syntax::source_map::Span;
use rustc_span::source_map::Span;

use crate::ich::StableHashingContext;
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
Expand Down
Loading

0 comments on commit 814e3af

Please sign in to comment.