1
Fork 0

Rename syntax_pos to rustc_span in source code

This commit is contained in:
Vadim Petrochenkov 2019-12-31 20:15:40 +03:00
parent 38aa6bdfd7
commit 70f1d57048
383 changed files with 601 additions and 601 deletions

View file

@ -9,5 +9,5 @@ name = "fmt_macros"
path = "lib.rs" path = "lib.rs"
[dependencies] [dependencies]
syntax_pos = { path = "../librustc_span", package = "rustc_span" } rustc_span = { path = "../librustc_span" }
rustc_lexer = { path = "../librustc_lexer" } rustc_lexer = { path = "../librustc_lexer" }

View file

@ -24,7 +24,7 @@ use std::iter;
use std::str; use std::str;
use std::string; use std::string;
use syntax_pos::{InnerSpan, Symbol}; use rustc_span::{InnerSpan, Symbol};
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
struct InnerOffset(usize); struct InnerOffset(usize);

View file

@ -144,7 +144,7 @@ fn format_align_fill() {
} }
#[test] #[test]
fn format_counts() { fn format_counts() {
use syntax_pos::{edition, Globals, GLOBALS}; use rustc_span::{edition, Globals, GLOBALS};
GLOBALS.set(&Globals::new(edition::DEFAULT_EDITION), || { GLOBALS.set(&Globals::new(edition::DEFAULT_EDITION), || {
same( same(
"{:10x}", "{:10x}",

View file

@ -30,7 +30,7 @@ rustc_index = { path = "../librustc_index" }
errors = { path = "../librustc_errors", package = "rustc_errors" } errors = { path = "../librustc_errors", package = "rustc_errors" }
rustc_serialize = { path = "../libserialize", package = "serialize" } rustc_serialize = { path = "../libserialize", package = "serialize" }
syntax = { path = "../libsyntax" } syntax = { path = "../libsyntax" }
syntax_pos = { path = "../librustc_span", package = "rustc_span" } rustc_span = { path = "../librustc_span" }
backtrace = "0.3.40" backtrace = "0.3.40"
parking_lot = "0.9" parking_lot = "0.9"
byteorder = { version = "1.3" } byteorder = { version = "1.3" }

View file

@ -65,9 +65,9 @@ use crate::traits::query::{
use crate::ty::subst::SubstsRef; use crate::ty::subst::SubstsRef;
use crate::ty::{self, ParamEnvAnd, Ty, TyCtxt}; use crate::ty::{self, ParamEnvAnd, Ty, TyCtxt};
use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_span::symbol::Symbol;
use std::fmt; use std::fmt;
use std::hash::Hash; use std::hash::Hash;
use syntax_pos::symbol::Symbol;
// erase!() just makes tokens go away. It's used to specify which macro argument // erase!() just makes tokens go away. It's used to specify which macro argument
// is repeated (i.e., which sub-expression of the macro we are in) but don't need // is repeated (i.e., which sub-expression of the macro we are in) but don't need

View file

@ -12,9 +12,9 @@ use crate::lint::builtin::UNUSED_ATTRIBUTES;
use crate::ty::query::Providers; use crate::ty::query::Providers;
use crate::ty::TyCtxt; use crate::ty::TyCtxt;
use rustc_span::Span;
use std::fmt::{self, Display}; use std::fmt::{self, Display};
use syntax::{attr, symbol::sym}; use syntax::{attr, symbol::sym};
use syntax_pos::Span;
use rustc_error_codes::*; use rustc_error_codes::*;

View file

@ -6,10 +6,10 @@ use crate::ty;
use crate::util::nodemap::DefIdMap; use crate::util::nodemap::DefIdMap;
use rustc_macros::HashStable; use rustc_macros::HashStable;
use rustc_span::hygiene::MacroKind;
use rustc_span::Span;
use syntax::ast; use syntax::ast;
use syntax::ast::NodeId; use syntax::ast::NodeId;
use syntax_pos::hygiene::MacroKind;
use syntax_pos::Span;
use std::fmt::Debug; use std::fmt::Debug;

View file

@ -36,8 +36,8 @@ use super::itemlikevisit::DeepVisitor;
use crate::hir::map::Map; use crate::hir::map::Map;
use crate::hir::*; use crate::hir::*;
use rustc_span::Span;
use syntax::ast::{Attribute, Ident, Name}; use syntax::ast::{Attribute, Ident, Name};
use syntax_pos::Span;
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub enum FnKind<'a> { pub enum FnKind<'a> {

View file

@ -15,8 +15,8 @@ use crate::hir as ast;
use crate::hir::intravisit::FnKind; use crate::hir::intravisit::FnKind;
use crate::hir::map; use crate::hir::map;
use crate::hir::{Expr, FnDecl, Node}; use crate::hir::{Expr, FnDecl, Node};
use rustc_span::Span;
use syntax::ast::{Attribute, Ident}; use syntax::ast::{Attribute, Ident};
use syntax_pos::Span;
/// An FnLikeNode is a Node that is like a fn, in that it has a decl /// An FnLikeNode is a Node that is like a fn, in that it has a decl
/// and a body (as well as a NodeId, a span, etc). /// and a body (as well as a NodeId, a span, etc).

View file

@ -11,10 +11,10 @@ use crate::session::Session;
use crate::util::nodemap::FxHashMap; use crate::util::nodemap::FxHashMap;
use rustc_data_structures::svh::Svh; use rustc_data_structures::svh::Svh;
use rustc_index::vec::IndexVec; use rustc_index::vec::IndexVec;
use rustc_span::Span;
use std::iter::repeat; use std::iter::repeat;
use syntax::ast::NodeId; use syntax::ast::NodeId;
use syntax::source_map::SourceMap; use syntax::source_map::SourceMap;
use syntax_pos::Span;
use crate::ich::StableHashingContext; use crate::ich::StableHashingContext;
use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; use rustc_data_structures::stable_hasher::{HashStable, StableHasher};

View file

@ -13,13 +13,13 @@ use crate::util::nodemap::NodeMap;
use rustc_data_structures::fx::FxHashMap; use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::stable_hasher::StableHasher; use rustc_data_structures::stable_hasher::StableHasher;
use rustc_index::vec::IndexVec; use rustc_index::vec::IndexVec;
use rustc_span::hygiene::ExpnId;
use rustc_span::symbol::{sym, Symbol};
use rustc_span::Span;
use std::borrow::Borrow; use std::borrow::Borrow;
use std::fmt::Write; use std::fmt::Write;
use std::hash::Hash; use std::hash::Hash;
use syntax::ast; use syntax::ast;
use syntax_pos::hygiene::ExpnId;
use syntax_pos::symbol::{sym, Symbol};
use syntax_pos::Span;
/// The `DefPathTable` maps `DefIndex`es to `DefKey`s and vice versa. /// The `DefPathTable` maps `DefIndex`es to `DefKey`s and vice versa.
/// Internally the `DefPathTable` holds a tree of `DefKey`s, where each `DefKey` /// Internally the `DefPathTable` holds a tree of `DefKey`s, where each `DefKey`

View file

@ -16,11 +16,11 @@ use crate::util::nodemap::FxHashMap;
use rustc_data_structures::svh::Svh; use rustc_data_structures::svh::Svh;
use rustc_index::vec::IndexVec; use rustc_index::vec::IndexVec;
use rustc_span::hygiene::MacroKind;
use rustc_span::{Span, DUMMY_SP};
use rustc_target::spec::abi::Abi; use rustc_target::spec::abi::Abi;
use syntax::ast::{self, Name, NodeId}; use syntax::ast::{self, Name, NodeId};
use syntax::source_map::Spanned; use syntax::source_map::Spanned;
use syntax_pos::hygiene::MacroKind;
use syntax_pos::{Span, DUMMY_SP};
pub mod blocks; pub mod blocks;
mod collector; mod collector;

View file

@ -19,6 +19,9 @@ use errors::FatalError;
use rustc_data_structures::sync::{par_for_each_in, Send, Sync}; use rustc_data_structures::sync::{par_for_each_in, Send, Sync};
use rustc_macros::HashStable; use rustc_macros::HashStable;
use rustc_serialize::{self, Decodable, Decoder, Encodable, Encoder}; use rustc_serialize::{self, Decodable, Decoder, Encodable, Encoder};
use rustc_span::source_map::{SourceMap, Spanned};
use rustc_span::symbol::{kw, sym, Symbol};
use rustc_span::{MultiSpan, Span, DUMMY_SP};
use rustc_target::spec::abi::Abi; use rustc_target::spec::abi::Abi;
use smallvec::SmallVec; use smallvec::SmallVec;
use std::collections::{BTreeMap, BTreeSet}; use std::collections::{BTreeMap, BTreeSet};
@ -30,9 +33,6 @@ pub use syntax::ast::{CaptureBy, Constness, Movability, Mutability, Unsafety};
use syntax::attr::{InlineAttr, OptimizeAttr}; use syntax::attr::{InlineAttr, OptimizeAttr};
use syntax::tokenstream::TokenStream; use syntax::tokenstream::TokenStream;
use syntax::util::parser::ExprPrecedence; use syntax::util::parser::ExprPrecedence;
use syntax_pos::source_map::{SourceMap, Spanned};
use syntax_pos::symbol::{kw, sym, Symbol};
use syntax_pos::{MultiSpan, Span, DUMMY_SP};
pub mod check_attr; pub mod check_attr;
pub mod def; pub mod def;

View file

@ -1,8 +1,8 @@
use crate::hir::def::{CtorOf, DefKind, Res}; use crate::hir::def::{CtorOf, DefKind, Res};
use crate::hir::def_id::DefId; use crate::hir::def_id::DefId;
use crate::hir::{self, HirId, PatKind}; use crate::hir::{self, HirId, PatKind};
use rustc_span::Span;
use syntax::ast; use syntax::ast;
use syntax_pos::Span;
use std::iter::{Enumerate, ExactSizeIterator}; use std::iter::{Enumerate, ExactSizeIterator};

View file

@ -1,3 +1,4 @@
use rustc_span::{self, BytePos, FileName};
use rustc_target::spec::abi::Abi; use rustc_target::spec::abi::Abi;
use syntax::ast; use syntax::ast;
use syntax::print::pp::Breaks::{Consistent, Inconsistent}; use syntax::print::pp::Breaks::{Consistent, Inconsistent};
@ -7,7 +8,6 @@ use syntax::sess::ParseSess;
use syntax::source_map::{SourceMap, Spanned}; use syntax::source_map::{SourceMap, Spanned};
use syntax::symbol::kw; use syntax::symbol::kw;
use syntax::util::parser::{self, AssocOp, Fixity}; use syntax::util::parser::{self, AssocOp, Fixity};
use syntax_pos::{self, BytePos, FileName};
use crate::hir; use crate::hir;
use crate::hir::{GenericArg, GenericParam, GenericParamKind}; use crate::hir::{GenericArg, GenericParam, GenericParamKind};
@ -178,7 +178,7 @@ impl<'a> State<'a> {
self.end(); // close the head-box self.end(); // close the head-box
} }
pub fn bclose_maybe_open(&mut self, span: syntax_pos::Span, close_box: bool) { pub fn bclose_maybe_open(&mut self, span: rustc_span::Span, close_box: bool) {
self.maybe_print_comment(span.hi()); self.maybe_print_comment(span.hi());
self.break_offset_if_not_bol(1, -(INDENT_UNIT as isize)); self.break_offset_if_not_bol(1, -(INDENT_UNIT as isize));
self.s.word("}"); self.s.word("}");
@ -187,7 +187,7 @@ impl<'a> State<'a> {
} }
} }
pub fn bclose(&mut self, span: syntax_pos::Span) { pub fn bclose(&mut self, span: rustc_span::Span) {
self.bclose_maybe_open(span, true) self.bclose_maybe_open(span, true)
} }
@ -223,7 +223,7 @@ impl<'a> State<'a> {
pub fn commasep_cmnt<T, F, G>(&mut self, b: Breaks, elts: &[T], mut op: F, mut get_span: G) pub fn commasep_cmnt<T, F, G>(&mut self, b: Breaks, elts: &[T], mut op: F, mut get_span: G)
where where
F: FnMut(&mut State<'_>, &T), F: FnMut(&mut State<'_>, &T),
G: FnMut(&T) -> syntax_pos::Span, G: FnMut(&T) -> rustc_span::Span,
{ {
self.rbox(0, b); self.rbox(0, b);
let len = elts.len(); let len = elts.len();
@ -704,7 +704,7 @@ impl<'a> State<'a> {
enum_definition: &hir::EnumDef<'_>, enum_definition: &hir::EnumDef<'_>,
generics: &hir::Generics<'_>, generics: &hir::Generics<'_>,
name: ast::Name, name: ast::Name,
span: syntax_pos::Span, span: rustc_span::Span,
visibility: &hir::Visibility<'_>, visibility: &hir::Visibility<'_>,
) { ) {
self.head(visibility_qualified(visibility, "enum")); self.head(visibility_qualified(visibility, "enum"));
@ -715,7 +715,7 @@ impl<'a> State<'a> {
self.print_variants(&enum_definition.variants, span) self.print_variants(&enum_definition.variants, span)
} }
pub fn print_variants(&mut self, variants: &[hir::Variant<'_>], span: syntax_pos::Span) { pub fn print_variants(&mut self, variants: &[hir::Variant<'_>], span: rustc_span::Span) {
self.bopen(); self.bopen();
for v in variants { for v in variants {
self.space_if_not_bol(); self.space_if_not_bol();
@ -763,7 +763,7 @@ impl<'a> State<'a> {
struct_def: &hir::VariantData<'_>, struct_def: &hir::VariantData<'_>,
generics: &hir::Generics<'_>, generics: &hir::Generics<'_>,
name: ast::Name, name: ast::Name,
span: syntax_pos::Span, span: rustc_span::Span,
print_finalizer: bool, print_finalizer: bool,
) { ) {
self.print_name(name); self.print_name(name);
@ -839,18 +839,18 @@ impl<'a> State<'a> {
match ti.kind { match ti.kind {
hir::TraitItemKind::Const(ref ty, default) => { hir::TraitItemKind::Const(ref ty, default) => {
let vis = let vis =
Spanned { span: syntax_pos::DUMMY_SP, node: hir::VisibilityKind::Inherited }; Spanned { span: rustc_span::DUMMY_SP, node: hir::VisibilityKind::Inherited };
self.print_associated_const(ti.ident, &ty, default, &vis); self.print_associated_const(ti.ident, &ty, default, &vis);
} }
hir::TraitItemKind::Method(ref sig, hir::TraitMethod::Required(ref arg_names)) => { hir::TraitItemKind::Method(ref sig, hir::TraitMethod::Required(ref arg_names)) => {
let vis = let vis =
Spanned { span: syntax_pos::DUMMY_SP, node: hir::VisibilityKind::Inherited }; Spanned { span: rustc_span::DUMMY_SP, node: hir::VisibilityKind::Inherited };
self.print_method_sig(ti.ident, sig, &ti.generics, &vis, arg_names, None); self.print_method_sig(ti.ident, sig, &ti.generics, &vis, arg_names, None);
self.s.word(";"); self.s.word(";");
} }
hir::TraitItemKind::Method(ref sig, hir::TraitMethod::Provided(body)) => { hir::TraitItemKind::Method(ref sig, hir::TraitMethod::Provided(body)) => {
let vis = let vis =
Spanned { span: syntax_pos::DUMMY_SP, node: hir::VisibilityKind::Inherited }; Spanned { span: rustc_span::DUMMY_SP, node: hir::VisibilityKind::Inherited };
self.head(""); self.head("");
self.print_method_sig(ti.ident, sig, &ti.generics, &vis, &[], Some(body)); self.print_method_sig(ti.ident, sig, &ti.generics, &vis, &[], Some(body));
self.nbsp(); self.nbsp();
@ -2097,8 +2097,8 @@ impl<'a> State<'a> {
} }
let generics = hir::Generics { let generics = hir::Generics {
params: &[], params: &[],
where_clause: hir::WhereClause { predicates: &[], span: syntax_pos::DUMMY_SP }, where_clause: hir::WhereClause { predicates: &[], span: rustc_span::DUMMY_SP },
span: syntax_pos::DUMMY_SP, span: rustc_span::DUMMY_SP,
}; };
self.print_fn( self.print_fn(
decl, decl,
@ -2110,7 +2110,7 @@ impl<'a> State<'a> {
}, },
name, name,
&generics, &generics,
&Spanned { span: syntax_pos::DUMMY_SP, node: hir::VisibilityKind::Inherited }, &Spanned { span: rustc_span::DUMMY_SP, node: hir::VisibilityKind::Inherited },
arg_names, arg_names,
None, None,
); );
@ -2119,7 +2119,7 @@ impl<'a> State<'a> {
pub fn maybe_print_trailing_comment( pub fn maybe_print_trailing_comment(
&mut self, &mut self,
span: syntax_pos::Span, span: rustc_span::Span,
next_pos: Option<BytePos>, next_pos: Option<BytePos>,
) { ) {
if let Some(cmnts) = self.comments() { if let Some(cmnts) = self.comments() {

View file

@ -6,7 +6,7 @@ use crate::hir::{self, HirId};
use crate::ty::query::Providers; use crate::ty::query::Providers;
use crate::ty::TyCtxt; use crate::ty::TyCtxt;
use rustc_data_structures::fx::{FxHashSet, FxIndexMap}; use rustc_data_structures::fx::{FxHashSet, FxIndexMap};
use syntax_pos::Span; use rustc_span::Span;
pub fn provide(providers: &mut Providers<'_>) { pub fn provide(providers: &mut Providers<'_>) {
providers.upvars = |tcx, def_id| { providers.upvars = |tcx, def_id| {

View file

@ -9,10 +9,10 @@ use crate::ty::{fast_reject, TyCtxt};
use std::cmp::Ord; use std::cmp::Ord;
use rustc_span::{BytePos, SourceFile};
use syntax::ast; use syntax::ast;
use syntax::source_map::SourceMap; use syntax::source_map::SourceMap;
use syntax::symbol::Symbol; use syntax::symbol::Symbol;
use syntax_pos::{BytePos, SourceFile};
use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_data_structures::stable_hasher::{HashStable, StableHasher, ToStableHashKey}; use rustc_data_structures::stable_hasher::{HashStable, StableHasher, ToStableHashKey};
@ -270,7 +270,7 @@ impl<'a> ToStableHashKey<StableHashingContext<'a>> for ast::NodeId {
} }
} }
impl<'a> syntax_pos::HashStableContext for StableHashingContext<'a> { impl<'a> rustc_span::HashStableContext for StableHashingContext<'a> {
fn hash_spans(&self) -> bool { fn hash_spans(&self) -> bool {
self.hash_spans self.hash_spans
} }

View file

@ -3,8 +3,8 @@
use crate::ich::StableHashingContext; use crate::ich::StableHashingContext;
use rustc_span::SourceFile;
use syntax::ast; use syntax::ast;
use syntax_pos::SourceFile;
use crate::hir::def_id::{CrateNum, DefId, CRATE_DEF_INDEX}; use crate::hir::def_id::{CrateNum, DefId, CRATE_DEF_INDEX};
@ -114,22 +114,22 @@ impl<'a> HashStable<StableHashingContext<'a>> for SourceFile {
} }
} }
fn stable_byte_pos(pos: ::syntax_pos::BytePos, source_file_start: ::syntax_pos::BytePos) -> u32 { fn stable_byte_pos(pos: ::rustc_span::BytePos, source_file_start: ::rustc_span::BytePos) -> u32 {
pos.0 - source_file_start.0 pos.0 - source_file_start.0
} }
fn stable_multibyte_char( fn stable_multibyte_char(
mbc: ::syntax_pos::MultiByteChar, mbc: ::rustc_span::MultiByteChar,
source_file_start: ::syntax_pos::BytePos, source_file_start: ::rustc_span::BytePos,
) -> (u32, u32) { ) -> (u32, u32) {
let ::syntax_pos::MultiByteChar { pos, bytes } = mbc; let ::rustc_span::MultiByteChar { pos, bytes } = mbc;
(pos.0 - source_file_start.0, bytes as u32) (pos.0 - source_file_start.0, bytes as u32)
} }
fn stable_non_narrow_char( fn stable_non_narrow_char(
swc: ::syntax_pos::NonNarrowChar, swc: ::rustc_span::NonNarrowChar,
source_file_start: ::syntax_pos::BytePos, source_file_start: ::rustc_span::BytePos,
) -> (u32, u32) { ) -> (u32, u32) {
let pos = swc.pos(); let pos = swc.pos();
let width = swc.width(); let width = swc.width();
@ -138,10 +138,10 @@ fn stable_non_narrow_char(
} }
fn stable_normalized_pos( fn stable_normalized_pos(
np: ::syntax_pos::NormalizedPos, np: ::rustc_span::NormalizedPos,
source_file_start: ::syntax_pos::BytePos, source_file_start: ::rustc_span::BytePos,
) -> (u32, u32) { ) -> (u32, u32) {
let ::syntax_pos::NormalizedPos { pos, diff } = np; let ::rustc_span::NormalizedPos { pos, diff } = np;
(pos.0 - source_file_start.0, diff) (pos.0 - source_file_start.0, diff)
} }

View file

@ -4,8 +4,8 @@ pub use self::hcx::{
hash_stable_trait_impls, NodeIdHashingMode, StableHashingContext, StableHashingContextProvider, hash_stable_trait_impls, NodeIdHashingMode, StableHashingContext, StableHashingContextProvider,
}; };
crate use rustc_data_structures::fingerprint::Fingerprint; crate use rustc_data_structures::fingerprint::Fingerprint;
pub use rustc_span::CachingSourceMapView;
use syntax::symbol::{sym, Symbol}; use syntax::symbol::{sym, Symbol};
pub use syntax_pos::CachingSourceMapView;
mod hcx; mod hcx;

View file

@ -190,7 +190,7 @@ impl CanonicalizeRegionMode for CanonicalizeQueryResponse {
// `delay_span_bug` to allow type error over an ICE. // `delay_span_bug` to allow type error over an ICE.
ty::tls::with_context(|c| { ty::tls::with_context(|c| {
c.tcx.sess.delay_span_bug( c.tcx.sess.delay_span_bug(
syntax_pos::DUMMY_SP, rustc_span::DUMMY_SP,
&format!("unexpected region in query response: `{:?}`", r), &format!("unexpected region in query response: `{:?}`", r),
); );
}); });

View file

@ -25,8 +25,8 @@ use crate::ty::{self, BoundVar, Ty, TyCtxt};
use crate::util::captures::Captures; use crate::util::captures::Captures;
use rustc_index::vec::Idx; use rustc_index::vec::Idx;
use rustc_index::vec::IndexVec; use rustc_index::vec::IndexVec;
use rustc_span::DUMMY_SP;
use std::fmt::Debug; use std::fmt::Debug;
use syntax_pos::DUMMY_SP;
impl<'tcx> InferCtxtBuilder<'tcx> { impl<'tcx> InferCtxtBuilder<'tcx> {
/// The "main method" for a canonicalized trait query. Given the /// The "main method" for a canonicalized trait query. Given the

View file

@ -40,8 +40,8 @@ use crate::ty::subst::SubstsRef;
use crate::ty::{self, InferConst, Ty, TyCtxt}; use crate::ty::{self, InferConst, Ty, TyCtxt};
use crate::ty::{IntType, UintType}; use crate::ty::{IntType, UintType};
use rustc_span::{Span, DUMMY_SP};
use syntax::ast; use syntax::ast;
use syntax_pos::{Span, DUMMY_SP};
#[derive(Clone)] #[derive(Clone)]
pub struct CombineFields<'infcx, 'tcx> { pub struct CombineFields<'infcx, 'tcx> {

View file

@ -67,9 +67,9 @@ use crate::ty::{
use errors::{Applicability, DiagnosticBuilder, DiagnosticStyledString}; use errors::{Applicability, DiagnosticBuilder, DiagnosticStyledString};
use rustc_error_codes::*; use rustc_error_codes::*;
use rustc_span::{Pos, Span};
use rustc_target::spec::abi; use rustc_target::spec::abi;
use std::{cmp, fmt}; use std::{cmp, fmt};
use syntax_pos::{Pos, Span};
mod note; mod note;

View file

@ -6,10 +6,10 @@ use crate::infer::InferCtxt;
use crate::ty::print::Print; use crate::ty::print::Print;
use crate::ty::{self, DefIdTree, Infer, Ty, TyVar}; use crate::ty::{self, DefIdTree, Infer, Ty, TyVar};
use errors::{Applicability, DiagnosticBuilder}; use errors::{Applicability, DiagnosticBuilder};
use rustc_span::Span;
use std::borrow::Cow; use std::borrow::Cow;
use syntax::source_map::DesugaringKind; use syntax::source_map::DesugaringKind;
use syntax::symbol::kw; use syntax::symbol::kw;
use syntax_pos::Span;
use rustc_error_codes::*; use rustc_error_codes::*;

View file

@ -6,7 +6,7 @@ use crate::infer::{Subtype, ValuePairs};
use crate::traits::ObligationCauseCode::CompareImplMethodObligation; use crate::traits::ObligationCauseCode::CompareImplMethodObligation;
use crate::ty::Ty; use crate::ty::Ty;
use crate::util::common::ErrorReported; use crate::util::common::ErrorReported;
use syntax_pos::Span; use rustc_span::Span;
impl<'a, 'tcx> NiceRegionError<'a, 'tcx> { impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
/// Print the error message for lifetime errors when the `impl` doesn't conform to the `trait`. /// Print the error message for lifetime errors when the `impl` doesn't conform to the `trait`.

View file

@ -5,7 +5,7 @@ use crate::hir;
use crate::hir::def_id::DefId; use crate::hir::def_id::DefId;
use crate::infer::error_reporting::nice_region_error::NiceRegionError; use crate::infer::error_reporting::nice_region_error::NiceRegionError;
use crate::ty::{self, DefIdTree, Region, Ty}; use crate::ty::{self, DefIdTree, Region, Ty};
use syntax_pos::Span; use rustc_span::Span;
// The struct contains the information about the anonymous region // The struct contains the information about the anonymous region
// we are searching for. // we are searching for.

View file

@ -21,8 +21,8 @@ use rustc_data_structures::graph::implementation::{
}; };
use rustc_index::bit_set::BitSet; use rustc_index::bit_set::BitSet;
use rustc_index::vec::{Idx, IndexVec}; use rustc_index::vec::{Idx, IndexVec};
use rustc_span::Span;
use std::fmt; use std::fmt;
use syntax_pos::Span;
mod graphviz; mod graphviz;

View file

@ -27,12 +27,12 @@ use crate::util::nodemap::{FxHashMap, FxHashSet};
use errors::DiagnosticBuilder; use errors::DiagnosticBuilder;
use rustc_data_structures::sync::Lrc; use rustc_data_structures::sync::Lrc;
use rustc_data_structures::unify as ut; use rustc_data_structures::unify as ut;
use rustc_span::symbol::Symbol;
use rustc_span::Span;
use std::cell::{Cell, Ref, RefCell, RefMut}; use std::cell::{Cell, Ref, RefCell, RefMut};
use std::collections::BTreeMap; use std::collections::BTreeMap;
use std::fmt; use std::fmt;
use syntax::ast; use syntax::ast;
use syntax_pos::symbol::Symbol;
use syntax_pos::Span;
use self::combine::CombineFields; use self::combine::CombineFields;
use self::lexical_region_resolve::LexicalRegionResolutions; use self::lexical_region_resolve::LexicalRegionResolutions;
@ -1728,7 +1728,7 @@ impl RegionVariableOrigin {
Coercion(a) => a, Coercion(a) => a,
EarlyBoundRegion(a, ..) => a, EarlyBoundRegion(a, ..) => a,
LateBoundRegion(a, ..) => a, LateBoundRegion(a, ..) => a,
BoundRegionInCoherence(_) => syntax_pos::DUMMY_SP, BoundRegionInCoherence(_) => rustc_span::DUMMY_SP,
UpvarRegion(_, a) => a, UpvarRegion(_, a) => a,
NLL(..) => bug!("NLL variable used with `span`"), NLL(..) => bug!("NLL variable used with `span`"),
} }

View file

@ -266,7 +266,7 @@ where
) -> Ty<'tcx> { ) -> Ty<'tcx> {
use crate::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind}; use crate::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
use crate::traits::WhereClause; use crate::traits::WhereClause;
use syntax_pos::DUMMY_SP; use rustc_span::DUMMY_SP;
match value_ty.kind { match value_ty.kind {
ty::Projection(other_projection_ty) => { ty::Projection(other_projection_ty) => {

View file

@ -13,7 +13,7 @@ use errors::DiagnosticBuilder;
use rustc::session::config::nightly_options; use rustc::session::config::nightly_options;
use rustc_data_structures::fx::FxHashMap; use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::sync::Lrc; use rustc_data_structures::sync::Lrc;
use syntax_pos::Span; use rustc_span::Span;
use rustc_error_codes::*; use rustc_error_codes::*;

View file

@ -4,7 +4,7 @@ use crate::infer::{GenericKind, InferCtxt};
use crate::traits::query::outlives_bounds::{self, OutlivesBound}; use crate::traits::query::outlives_bounds::{self, OutlivesBound};
use crate::ty::{self, Ty}; use crate::ty::{self, Ty};
use rustc_data_structures::fx::FxHashMap; use rustc_data_structures::fx::FxHashMap;
use syntax_pos::Span; use rustc_span::Span;
/// The `OutlivesEnvironment` collects information about what outlives /// The `OutlivesEnvironment` collects information about what outlives
/// what in a given type-checking setting. For example, if we have a /// what in a given type-checking setting. For example, if we have a

View file

@ -15,7 +15,7 @@ use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_data_structures::sync::Lrc; use rustc_data_structures::sync::Lrc;
use rustc_data_structures::unify as ut; use rustc_data_structures::unify as ut;
use rustc_index::vec::IndexVec; use rustc_index::vec::IndexVec;
use syntax_pos::Span; use rustc_span::Span;
use std::collections::BTreeMap; use std::collections::BTreeMap;
use std::ops::Range; use std::ops::Range;

View file

@ -1,7 +1,7 @@
use crate::hir::def_id::DefId; use crate::hir::def_id::DefId;
use crate::ty::{self, Ty, TyVid}; use crate::ty::{self, Ty, TyVid};
use rustc_span::Span;
use syntax::symbol::Symbol; use syntax::symbol::Symbol;
use syntax_pos::Span;
use rustc_data_structures::snapshot_vec as sv; use rustc_data_structures::snapshot_vec as sv;
use rustc_data_structures::unify as ut; use rustc_data_structures::unify as ut;

View file

@ -1,8 +1,8 @@
use crate::ty::{self, FloatVarValue, InferConst, IntVarValue, Ty, TyCtxt}; use crate::ty::{self, FloatVarValue, InferConst, IntVarValue, Ty, TyCtxt};
use rustc_data_structures::unify::InPlace; use rustc_data_structures::unify::InPlace;
use rustc_data_structures::unify::{EqUnifyValue, NoError, UnificationTable, UnifyKey, UnifyValue}; use rustc_data_structures::unify::{EqUnifyValue, NoError, UnificationTable, UnifyKey, UnifyValue};
use rustc_span::{Span, DUMMY_SP};
use syntax::symbol::Symbol; use syntax::symbol::Symbol;
use syntax_pos::{Span, DUMMY_SP};
use std::cell::RefMut; use std::cell::RefMut;
use std::cmp; use std::cmp;

View file

@ -34,11 +34,11 @@ use crate::util::nodemap::FxHashMap;
use errors::DiagnosticBuilder; use errors::DiagnosticBuilder;
use rustc_data_structures::sync::{self, join, par_iter, ParallelIterator}; use rustc_data_structures::sync::{self, join, par_iter, ParallelIterator};
use rustc_span::{symbol::Symbol, MultiSpan, Span};
use std::slice; use std::slice;
use syntax::ast; use syntax::ast;
use syntax::util::lev_distance::find_best_match_for_name; use syntax::util::lev_distance::find_best_match_for_name;
use syntax::visit as ast_visit; use syntax::visit as ast_visit;
use syntax_pos::{symbol::Symbol, MultiSpan, Span};
use rustc_error_codes::*; use rustc_error_codes::*;

View file

@ -32,11 +32,11 @@ use crate::ty::query::Providers;
use crate::ty::TyCtxt; use crate::ty::TyCtxt;
use crate::util::nodemap::NodeMap; use crate::util::nodemap::NodeMap;
use errors::{DiagnosticBuilder, DiagnosticId}; use errors::{DiagnosticBuilder, DiagnosticId};
use rustc_span::hygiene::MacroKind;
use rustc_span::Span;
use syntax::ast; use syntax::ast;
use syntax::source_map::{DesugaringKind, ExpnKind, MultiSpan}; use syntax::source_map::{DesugaringKind, ExpnKind, MultiSpan};
use syntax::symbol::Symbol; use syntax::symbol::Symbol;
use syntax_pos::hygiene::MacroKind;
use syntax_pos::Span;
pub use crate::lint::context::{ pub use crate::lint::context::{
check_ast_crate, check_crate, late_lint_mod, BufferedEarlyLint, CheckLintNameResult, check_ast_crate, check_crate, late_lint_mod, BufferedEarlyLint, CheckLintNameResult,

View file

@ -12,13 +12,13 @@ use rustc_data_structures::svh::Svh;
use rustc_data_structures::sync::{self, MetadataRef}; use rustc_data_structures::sync::{self, MetadataRef};
use rustc_macros::HashStable; use rustc_macros::HashStable;
use rustc_span::Span;
use rustc_target::spec::Target; use rustc_target::spec::Target;
use std::any::Any; use std::any::Any;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use syntax::ast; use syntax::ast;
use syntax::expand::allocator::AllocatorKind; use syntax::expand::allocator::AllocatorKind;
use syntax::symbol::Symbol; use syntax::symbol::Symbol;
use syntax_pos::Span;
pub use self::NativeLibraryKind::*; pub use self::NativeLibraryKind::*;
pub use rustc_session::utils::NativeLibraryKind; pub use rustc_session::utils::NativeLibraryKind;

View file

@ -19,9 +19,9 @@ use crate::util::nodemap::FxHashMap;
use crate::hir; use crate::hir;
use crate::hir::itemlikevisit::ItemLikeVisitor; use crate::hir::itemlikevisit::ItemLikeVisitor;
use rustc_macros::HashStable; use rustc_macros::HashStable;
use rustc_span::Span;
use syntax::ast; use syntax::ast;
use syntax::symbol::{sym, Symbol}; use syntax::symbol::{sym, Symbol};
use syntax_pos::Span;
use rustc_error_codes::*; use rustc_error_codes::*;

View file

@ -16,7 +16,7 @@ use crate::util::nodemap::FxHashMap;
use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_index::vec::Idx; use rustc_index::vec::Idx;
use rustc_macros::HashStable; use rustc_macros::HashStable;
use syntax_pos::{Span, DUMMY_SP}; use rustc_span::{Span, DUMMY_SP};
use std::fmt; use std::fmt;

View file

@ -16,12 +16,12 @@ use crate::ty::{self, TyCtxt};
use crate::util::nodemap::{FxHashMap, FxHashSet}; use crate::util::nodemap::{FxHashMap, FxHashSet};
use errors::DiagnosticBuilder; use errors::DiagnosticBuilder;
use rustc_feature::GateIssue; use rustc_feature::GateIssue;
use rustc_span::{MultiSpan, Span};
use syntax::ast::{Attribute, CRATE_NODE_ID}; use syntax::ast::{Attribute, CRATE_NODE_ID};
use syntax::attr::{self, ConstStability, Deprecation, RustcDeprecation, Stability}; use syntax::attr::{self, ConstStability, Deprecation, RustcDeprecation, Stability};
use syntax::errors::Applicability; use syntax::errors::Applicability;
use syntax::feature_gate::{feature_err, feature_err_issue}; use syntax::feature_gate::{feature_err, feature_err_issue};
use syntax::symbol::{sym, Symbol}; use syntax::symbol::{sym, Symbol};
use syntax_pos::{MultiSpan, Span};
use std::cmp::Ordering; use std::cmp::Ordering;
use std::mem::replace; use std::mem::replace;

View file

@ -9,10 +9,10 @@ use crate::hir::intravisit;
use crate::hir::intravisit::{NestedVisitorMap, Visitor}; use crate::hir::intravisit::{NestedVisitorMap, Visitor};
use crate::ty::TyCtxt; use crate::ty::TyCtxt;
use rustc_data_structures::fx::FxHashSet; use rustc_data_structures::fx::FxHashSet;
use rustc_span::Span;
use rustc_target::spec::PanicStrategy; use rustc_target::spec::PanicStrategy;
use syntax::ast; use syntax::ast;
use syntax::symbol::{sym, Symbol}; use syntax::symbol::{sym, Symbol};
use syntax_pos::Span;
use rustc_error_codes::*; use rustc_error_codes::*;

View file

@ -11,10 +11,10 @@ use backtrace::Backtrace;
use errors::DiagnosticBuilder; use errors::DiagnosticBuilder;
use hir::GeneratorKind; use hir::GeneratorKind;
use rustc_macros::HashStable; use rustc_macros::HashStable;
use rustc_span::{Pos, Span};
use rustc_target::spec::abi::Abi; use rustc_target::spec::abi::Abi;
use std::{any::Any, env, fmt}; use std::{any::Any, env, fmt};
use syntax::symbol::Symbol; use syntax::symbol::Symbol;
use syntax_pos::{Pos, Span};
use rustc_error_codes::*; use rustc_error_codes::*;

View file

@ -4,7 +4,7 @@ use crate::hir::def_id::DefId;
use crate::mir; use crate::mir;
use crate::ty::subst::{InternalSubsts, SubstsRef}; use crate::ty::subst::{InternalSubsts, SubstsRef};
use crate::ty::{self, TyCtxt}; use crate::ty::{self, TyCtxt};
use syntax_pos::Span; use rustc_span::Span;
impl<'tcx> TyCtxt<'tcx> { impl<'tcx> TyCtxt<'tcx> {
/// Evaluates a constant without providing any substitutions. This is useful to evaluate consts /// Evaluates a constant without providing any substitutions. This is useful to evaluate consts

View file

@ -27,6 +27,7 @@ use rustc_index::bit_set::BitMatrix;
use rustc_index::vec::{Idx, IndexVec}; use rustc_index::vec::{Idx, IndexVec};
use rustc_macros::HashStable; use rustc_macros::HashStable;
use rustc_serialize::{Decodable, Encodable}; use rustc_serialize::{Decodable, Encodable};
use rustc_span::{Span, DUMMY_SP};
use smallvec::SmallVec; use smallvec::SmallVec;
use std::borrow::Cow; use std::borrow::Cow;
use std::fmt::{self, Debug, Display, Formatter, Write}; use std::fmt::{self, Debug, Display, Formatter, Write};
@ -36,7 +37,6 @@ use std::{iter, mem, option, u32};
pub use syntax::ast::Mutability; pub use syntax::ast::Mutability;
use syntax::ast::Name; use syntax::ast::Name;
use syntax::symbol::Symbol; use syntax::symbol::Symbol;
use syntax_pos::{Span, DUMMY_SP};
pub use crate::mir::cache::{BodyAndCache, ReadOnlyBodyAndCache}; pub use crate::mir::cache::{BodyAndCache, ReadOnlyBodyAndCache};
pub use crate::mir::interpret::AssertMessage; pub use crate::mir::interpret::AssertMessage;

View file

@ -1,7 +1,7 @@
use crate::mir::*; use crate::mir::*;
use crate::ty::subst::SubstsRef; use crate::ty::subst::SubstsRef;
use crate::ty::{CanonicalUserTypeAnnotation, Ty}; use crate::ty::{CanonicalUserTypeAnnotation, Ty};
use syntax_pos::Span; use rustc_span::Span;
// # The MIR Visitor // # The MIR Visitor
// //

View file

@ -13,8 +13,8 @@ use crate::ty::query::QueryDescription;
use crate::ty::subst::SubstsRef; use crate::ty::subst::SubstsRef;
use crate::ty::{self, ParamEnvAnd, Ty, TyCtxt}; use crate::ty::{self, ParamEnvAnd, Ty, TyCtxt};
use rustc_span::symbol::Symbol;
use std::borrow::Cow; use std::borrow::Cow;
use syntax_pos::symbol::Symbol;
// Each of these queries corresponds to a function pointer field in the // Each of these queries corresponds to a function pointer field in the
// `Providers` struct for requesting a value of that type, and a method // `Providers` struct for requesting a value of that type, and a method
@ -497,7 +497,7 @@ rustc_queries! {
desc { "extract field of const" } desc { "extract field of const" }
} }
query const_caller_location(key: (syntax_pos::Symbol, u32, u32)) -> &'tcx ty::Const<'tcx> { query const_caller_location(key: (rustc_span::Symbol, u32, u32)) -> &'tcx ty::Const<'tcx> {
no_force no_force
desc { "get a &core::panic::Location referring to a span" } desc { "get a &core::panic::Location referring to a span" }
} }

View file

@ -12,8 +12,8 @@ use crate::traits::{self, Normalized, Obligation, ObligationCause, SelectionCont
use crate::ty::fold::TypeFoldable; use crate::ty::fold::TypeFoldable;
use crate::ty::subst::Subst; use crate::ty::subst::Subst;
use crate::ty::{self, Ty, TyCtxt}; use crate::ty::{self, Ty, TyCtxt};
use rustc_span::DUMMY_SP;
use syntax::symbol::sym; use syntax::symbol::sym;
use syntax_pos::DUMMY_SP;
/// Whether we do the orphan check relative to this crate or /// Whether we do the orphan check relative to this crate or
/// to some remote crate. /// to some remote crate.

View file

@ -25,11 +25,11 @@ use crate::util::nodemap::{FxHashMap, FxHashSet};
use errors::{pluralize, Applicability, DiagnosticBuilder, Style}; use errors::{pluralize, Applicability, DiagnosticBuilder, Style};
use rustc::hir::def_id::LOCAL_CRATE; use rustc::hir::def_id::LOCAL_CRATE;
use rustc_span::source_map::SourceMap;
use rustc_span::{ExpnKind, MultiSpan, Span, DUMMY_SP};
use std::fmt; use std::fmt;
use syntax::ast; use syntax::ast;
use syntax::symbol::{kw, sym}; use syntax::symbol::{kw, sym};
use syntax_pos::source_map::SourceMap;
use syntax_pos::{ExpnKind, MultiSpan, Span, DUMMY_SP};
use rustc_error_codes::*; use rustc_error_codes::*;

View file

@ -32,8 +32,8 @@ use crate::ty::{self, AdtKind, GenericParamDefKind, List, ToPredicate, Ty, TyCtx
use crate::util::common::ErrorReported; use crate::util::common::ErrorReported;
use chalk_engine; use chalk_engine;
use rustc_macros::HashStable; use rustc_macros::HashStable;
use rustc_span::{Span, DUMMY_SP};
use syntax::ast; use syntax::ast;
use syntax_pos::{Span, DUMMY_SP};
use std::fmt::Debug; use std::fmt::Debug;
use std::rc::Rc; use std::rc::Rc;

View file

@ -16,11 +16,11 @@ use crate::lint;
use crate::traits::{self, Obligation, ObligationCause}; use crate::traits::{self, Obligation, ObligationCause};
use crate::ty::subst::{InternalSubsts, Subst}; use crate::ty::subst::{InternalSubsts, Subst};
use crate::ty::{self, Predicate, ToPredicate, Ty, TyCtxt, TypeFoldable}; use crate::ty::{self, Predicate, ToPredicate, Ty, TyCtxt, TypeFoldable};
use rustc_span::{Span, DUMMY_SP};
use std::borrow::Cow; use std::borrow::Cow;
use std::iter::{self}; use std::iter::{self};
use syntax::ast::{self}; use syntax::ast::{self};
use syntax::symbol::Symbol; use syntax::symbol::Symbol;
use syntax_pos::{Span, DUMMY_SP};
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
pub enum ObjectSafetyViolation { pub enum ObjectSafetyViolation {

View file

@ -5,10 +5,10 @@ use crate::ty::{self, GenericParamDefKind, TyCtxt};
use crate::util::common::ErrorReported; use crate::util::common::ErrorReported;
use crate::util::nodemap::FxHashMap; use crate::util::nodemap::FxHashMap;
use rustc_span::Span;
use syntax::ast::{MetaItem, NestedMetaItem}; use syntax::ast::{MetaItem, NestedMetaItem};
use syntax::attr; use syntax::attr;
use syntax::symbol::{kw, sym, Symbol}; use syntax::symbol::{kw, sym, Symbol};
use syntax_pos::Span;
use rustc_error_codes::*; use rustc_error_codes::*;

View file

@ -21,9 +21,9 @@ use crate::ty::{self, ToPolyTraitRef, ToPredicate, Ty, TyCtxt};
use crate::util::common::FN_OUTPUT_NAME; use crate::util::common::FN_OUTPUT_NAME;
use rustc_data_structures::snapshot_map::{Snapshot, SnapshotMap}; use rustc_data_structures::snapshot_map::{Snapshot, SnapshotMap};
use rustc_macros::HashStable; use rustc_macros::HashStable;
use rustc_span::DUMMY_SP;
use syntax::ast::Ident; use syntax::ast::Ident;
use syntax::symbol::sym; use syntax::symbol::sym;
use syntax_pos::DUMMY_SP;
/// Depending on the stage of compilation, we want projection to be /// Depending on the stage of compilation, we want projection to be
/// more or less conservative. /// more or less conservative.

View file

@ -19,7 +19,7 @@ use crate::traits::{self, coherence, FutureCompatOverlapErrorKind, ObligationCau
use crate::ty::subst::{InternalSubsts, Subst, SubstsRef}; use crate::ty::subst::{InternalSubsts, Subst, SubstsRef};
use crate::ty::{self, TyCtxt, TypeFoldable}; use crate::ty::{self, TyCtxt, TypeFoldable};
use rustc_data_structures::fx::FxHashSet; use rustc_data_structures::fx::FxHashSet;
use syntax_pos::DUMMY_SP; use rustc_span::DUMMY_SP;
use super::util::impl_trait_ref_and_oblig; use super::util::impl_trait_ref_and_oblig;
use super::{FulfillmentContext, SelectionContext}; use super::{FulfillmentContext, SelectionContext};

View file

@ -1,6 +1,6 @@
use errors::DiagnosticBuilder; use errors::DiagnosticBuilder;
use rustc_span::Span;
use smallvec::SmallVec; use smallvec::SmallVec;
use syntax_pos::Span;
use crate::hir; use crate::hir;
use crate::hir::def_id::DefId; use crate::hir::def_id::DefId;

View file

@ -14,9 +14,9 @@ use crate::ty::subst::SubstsRef;
use crate::ty::{self, List, Ty, TyCtxt}; use crate::ty::{self, List, Ty, TyCtxt};
use rustc_data_structures::fx::FxHashMap; use rustc_data_structures::fx::FxHashMap;
use rustc_serialize::{opaque, Decodable, Decoder, Encodable, Encoder}; use rustc_serialize::{opaque, Decodable, Decoder, Encodable, Encoder};
use rustc_span::Span;
use std::hash::Hash; use std::hash::Hash;
use std::intrinsics; use std::intrinsics;
use syntax_pos::Span;
/// The shorthand encoding uses an enum's variant index `usize` /// The shorthand encoding uses an enum's variant index `usize`
/// and is offset by this value so it never matches a real variant. /// and is offset by this value so it never matches a real variant.
@ -355,7 +355,7 @@ macro_rules! implement_ty_decoder {
use $crate::ty::subst::SubstsRef; use $crate::ty::subst::SubstsRef;
use $crate::hir::def_id::{CrateNum}; use $crate::hir::def_id::{CrateNum};
use syntax_pos::Span; use rustc_span::Span;
use super::$DecoderName; use super::$DecoderName;

View file

@ -3,9 +3,9 @@ use crate::hir::def_id::DefId;
use crate::hir::map::blocks::FnLikeNode; use crate::hir::map::blocks::FnLikeNode;
use crate::ty::query::Providers; use crate::ty::query::Providers;
use crate::ty::TyCtxt; use crate::ty::TyCtxt;
use rustc_span::symbol::Symbol;
use rustc_target::spec::abi::Abi; use rustc_target::spec::abi::Abi;
use syntax::attr; use syntax::attr;
use syntax_pos::symbol::Symbol;
impl<'tcx> TyCtxt<'tcx> { impl<'tcx> TyCtxt<'tcx> {
/// Whether the `def_id` counts as const fn in your current crate, considering all active /// Whether the `def_id` counts as const fn in your current crate, considering all active

View file

@ -59,6 +59,7 @@ use rustc_data_structures::stable_hasher::{
use rustc_data_structures::sync::{Lock, Lrc, WorkerLocal}; use rustc_data_structures::sync::{Lock, Lrc, WorkerLocal};
use rustc_index::vec::{Idx, IndexVec}; use rustc_index::vec::{Idx, IndexVec};
use rustc_macros::HashStable; use rustc_macros::HashStable;
use rustc_span::Span;
use rustc_target::spec::abi; use rustc_target::spec::abi;
use smallvec::SmallVec; use smallvec::SmallVec;
use std::any::Any; use std::any::Any;
@ -76,7 +77,6 @@ use syntax::attr;
use syntax::expand::allocator::AllocatorKind; use syntax::expand::allocator::AllocatorKind;
use syntax::source_map::MultiSpan; use syntax::source_map::MultiSpan;
use syntax::symbol::{kw, sym, Symbol}; use syntax::symbol::{kw, sym, Symbol};
use syntax_pos::Span;
pub struct AllArenas { pub struct AllArenas {
pub interner: SyncDroplessArena, pub interner: SyncDroplessArena,

View file

@ -3,10 +3,10 @@ use crate::hir::def_id::DefId;
use crate::ty::{self, BoundRegion, Region, Ty, TyCtxt}; use crate::ty::{self, BoundRegion, Region, Ty, TyCtxt};
use errors::{Applicability, DiagnosticBuilder}; use errors::{Applicability, DiagnosticBuilder};
use rustc_span::Span;
use rustc_target::spec::abi; use rustc_target::spec::abi;
use syntax::ast; use syntax::ast;
use syntax::errors::pluralize; use syntax::errors::pluralize;
use syntax_pos::Span;
use std::borrow::Cow; use std::borrow::Cow;
use std::fmt; use std::fmt;

View file

@ -1,9 +1,9 @@
use crate::session::{self, DataTypeKind}; use crate::session::{self, DataTypeKind};
use crate::ty::{self, subst::SubstsRef, ReprOptions, Ty, TyCtxt, TypeFoldable}; use crate::ty::{self, subst::SubstsRef, ReprOptions, Ty, TyCtxt, TypeFoldable};
use rustc_span::DUMMY_SP;
use syntax::ast::{self, Ident, IntTy, UintTy}; use syntax::ast::{self, Ident, IntTy, UintTy};
use syntax::attr; use syntax::attr;
use syntax_pos::DUMMY_SP;
use std::cmp; use std::cmp;
use std::fmt; use std::fmt;

View file

@ -35,6 +35,9 @@ use rustc_macros::HashStable;
use rustc_data_structures::sync::{self, par_iter, Lrc, ParallelIterator}; use rustc_data_structures::sync::{self, par_iter, Lrc, ParallelIterator};
use rustc_serialize::{self, Encodable, Encoder}; use rustc_serialize::{self, Encodable, Encoder};
use rustc_span::hygiene::ExpnId;
use rustc_span::symbol::{kw, sym, Symbol};
use rustc_span::Span;
use rustc_target::abi::Align; use rustc_target::abi::Align;
use std::cell::RefCell; use std::cell::RefCell;
use std::cmp::{self, Ordering}; use std::cmp::{self, Ordering};
@ -46,9 +49,6 @@ use std::slice;
use std::{mem, ptr}; use std::{mem, ptr};
use syntax::ast::{self, Ident, Name, NodeId}; use syntax::ast::{self, Ident, Name, NodeId};
use syntax::attr; use syntax::attr;
use syntax_pos::hygiene::ExpnId;
use syntax_pos::symbol::{kw, sym, Symbol};
use syntax_pos::Span;
use rustc_data_structures::fx::FxIndexMap; use rustc_data_structures::fx::FxIndexMap;
use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; use rustc_data_structures::stable_hasher::{HashStable, StableHasher};

View file

@ -4,7 +4,7 @@ use crate::ty::query::Query;
use crate::ty::tls; use crate::ty::tls;
use rustc_data_structures::sync::Lrc; use rustc_data_structures::sync::Lrc;
use syntax_pos::Span; use rustc_span::Span;
#[cfg(not(parallel_compiler))] #[cfg(not(parallel_compiler))]
use std::ptr; use std::ptr;
@ -17,9 +17,9 @@ use {
rustc_data_structures::sync::Lock, rustc_data_structures::sync::Lock,
rustc_data_structures::{jobserver, OnDrop}, rustc_data_structures::{jobserver, OnDrop},
rustc_rayon_core as rayon_core, rustc_rayon_core as rayon_core,
rustc_span::DUMMY_SP,
std::iter::FromIterator, std::iter::FromIterator,
std::{mem, process, thread}, std::{mem, process, thread},
syntax_pos::DUMMY_SP,
}; };
/// Represents a span and a query key. /// Represents a span and a query key.
@ -432,16 +432,16 @@ pub unsafe fn handle_deadlock() {
let gcx_ptr = tls::GCX_PTR.with(|gcx_ptr| gcx_ptr as *const _); let gcx_ptr = tls::GCX_PTR.with(|gcx_ptr| gcx_ptr as *const _);
let gcx_ptr = &*gcx_ptr; let gcx_ptr = &*gcx_ptr;
let syntax_pos_globals = let rustc_span_globals =
syntax_pos::GLOBALS.with(|syntax_pos_globals| syntax_pos_globals as *const _); rustc_span::GLOBALS.with(|rustc_span_globals| rustc_span_globals as *const _);
let syntax_pos_globals = &*syntax_pos_globals; let rustc_span_globals = &*rustc_span_globals;
let syntax_globals = syntax::GLOBALS.with(|syntax_globals| syntax_globals as *const _); let syntax_globals = syntax::GLOBALS.with(|syntax_globals| syntax_globals as *const _);
let syntax_globals = &*syntax_globals; let syntax_globals = &*syntax_globals;
thread::spawn(move || { thread::spawn(move || {
tls::GCX_PTR.set(gcx_ptr, || { tls::GCX_PTR.set(gcx_ptr, || {
syntax::GLOBALS.set(syntax_globals, || { syntax::GLOBALS.set(syntax_globals, || {
syntax_pos::GLOBALS rustc_span::GLOBALS
.set(syntax_pos_globals, || tls::with_global(|tcx| deadlock(tcx, &registry))) .set(rustc_span_globals, || tls::with_global(|tcx| deadlock(tcx, &registry)))
}); });
}) })
}); });

View file

@ -8,8 +8,8 @@ use crate::ty::fast_reject::SimplifiedType;
use crate::ty::subst::SubstsRef; use crate::ty::subst::SubstsRef;
use crate::ty::{self, Ty, TyCtxt}; use crate::ty::{self, Ty, TyCtxt};
use syntax_pos::symbol::Symbol; use rustc_span::symbol::Symbol;
use syntax_pos::{Span, DUMMY_SP}; use rustc_span::{Span, DUMMY_SP};
/// The `Key` trait controls what types can legally be used as the key /// The `Key` trait controls what types can legally be used as the key
/// for a query. /// for a query.

View file

@ -47,6 +47,7 @@ use rustc_data_structures::sync::Lrc;
use rustc_index::vec::IndexVec; use rustc_index::vec::IndexVec;
use rustc_target::spec::PanicStrategy; use rustc_target::spec::PanicStrategy;
use rustc_span::{Span, DUMMY_SP};
use std::any::type_name; use std::any::type_name;
use std::borrow::Cow; use std::borrow::Cow;
use std::ops::Deref; use std::ops::Deref;
@ -54,7 +55,6 @@ use std::sync::Arc;
use syntax::ast; use syntax::ast;
use syntax::attr; use syntax::attr;
use syntax::symbol::Symbol; use syntax::symbol::Symbol;
use syntax_pos::{Span, DUMMY_SP};
#[macro_use] #[macro_use]
mod plumbing; mod plumbing;

View file

@ -20,11 +20,11 @@ use rustc_serialize::{
opaque, Decodable, Decoder, Encodable, Encoder, SpecializedDecoder, SpecializedEncoder, opaque, Decodable, Decoder, Encodable, Encoder, SpecializedDecoder, SpecializedEncoder,
UseSpecializedDecodable, UseSpecializedEncodable, UseSpecializedDecodable, UseSpecializedEncodable,
}; };
use rustc_span::hygiene::{ExpnId, SyntaxContext};
use rustc_span::{BytePos, SourceFile, Span, DUMMY_SP};
use std::mem; use std::mem;
use syntax::ast::{Ident, NodeId}; use syntax::ast::{Ident, NodeId};
use syntax::source_map::{SourceMap, StableSourceFileId}; use syntax::source_map::{SourceMap, StableSourceFileId};
use syntax_pos::hygiene::{ExpnId, SyntaxContext};
use syntax_pos::{BytePos, SourceFile, Span, DUMMY_SP};
const TAG_FILE_FOOTER: u128 = 0xC0FFEE_C0FFEE_C0FFEE_C0FFEE_C0FFEE; const TAG_FILE_FOOTER: u128 = 0xC0FFEE_C0FFEE_C0FFEE_C0FFEE_C0FFEE;

View file

@ -20,12 +20,12 @@ use rustc_data_structures::fx::{FxHashMap, FxHasher};
use rustc_data_structures::sharded::Sharded; use rustc_data_structures::sharded::Sharded;
use rustc_data_structures::sync::{Lock, Lrc}; use rustc_data_structures::sync::{Lock, Lrc};
use rustc_data_structures::thin_vec::ThinVec; use rustc_data_structures::thin_vec::ThinVec;
use rustc_span::Span;
use std::collections::hash_map::Entry; use std::collections::hash_map::Entry;
use std::hash::{Hash, Hasher}; use std::hash::{Hash, Hasher};
use std::mem; use std::mem;
use std::ptr; use std::ptr;
use syntax::source_map::DUMMY_SP; use syntax::source_map::DUMMY_SP;
use syntax_pos::Span;
use rustc_error_codes::*; use rustc_error_codes::*;

View file

@ -274,7 +274,7 @@ CloneTypeFoldableAndLiftImpls! {
crate::middle::region::Scope, crate::middle::region::Scope,
::syntax::ast::FloatTy, ::syntax::ast::FloatTy,
::syntax::ast::NodeId, ::syntax::ast::NodeId,
::syntax_pos::symbol::Symbol, ::rustc_span::symbol::Symbol,
crate::hir::def::Res, crate::hir::def::Res,
crate::hir::def_id::DefId, crate::hir::def_id::DefId,
crate::hir::InlineAsmInner, crate::hir::InlineAsmInner,
@ -303,7 +303,7 @@ CloneTypeFoldableAndLiftImpls! {
crate::ty::RegionVid, crate::ty::RegionVid,
crate::ty::UniverseIndex, crate::ty::UniverseIndex,
crate::ty::Variance, crate::ty::Variance,
::syntax_pos::Span, ::rustc_span::Span,
} }
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////

View file

@ -5,7 +5,7 @@ use rustc::traits::{self, ConstPatternStructural, TraitEngine};
use rustc_data_structures::fx::FxHashSet; use rustc_data_structures::fx::FxHashSet;
use syntax_pos::Span; use rustc_span::Span;
use crate::ty::fold::{TypeFoldable, TypeVisitor}; use crate::ty::fold::{TypeFoldable, TypeVisitor};
use crate::ty::{self, AdtDef, Ty, TyCtxt}; use crate::ty::{self, AdtDef, Ty, TyCtxt};

View file

@ -8,8 +8,8 @@ use crate::ty::{self, Lift, List, ParamConst, Ty, TyCtxt};
use rustc_macros::HashStable; use rustc_macros::HashStable;
use rustc_serialize::{self, Decodable, Decoder, Encodable, Encoder}; use rustc_serialize::{self, Decodable, Decoder, Encodable, Encoder};
use rustc_span::{Span, DUMMY_SP};
use smallvec::SmallVec; use smallvec::SmallVec;
use syntax_pos::{Span, DUMMY_SP};
use core::intrinsics; use core::intrinsics;
use std::cmp::Ordering; use std::cmp::Ordering;

View file

@ -18,10 +18,10 @@ use crate::util::common::ErrorReported;
use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_macros::HashStable; use rustc_macros::HashStable;
use rustc_span::{Span, DUMMY_SP};
use std::{cmp, fmt}; use std::{cmp, fmt};
use syntax::ast; use syntax::ast;
use syntax::attr::{self, SignedInt, UnsignedInt}; use syntax::attr::{self, SignedInt, UnsignedInt};
use syntax_pos::{Span, DUMMY_SP};
#[derive(Copy, Clone, Debug)] #[derive(Copy, Clone, Debug)]
pub struct Discr<'tcx> { pub struct Discr<'tcx> {

View file

@ -5,9 +5,9 @@ use crate::middle::lang_items;
use crate::traits::{self, AssocTypeBoundData}; use crate::traits::{self, AssocTypeBoundData};
use crate::ty::subst::SubstsRef; use crate::ty::subst::SubstsRef;
use crate::ty::{self, ToPredicate, Ty, TyCtxt, TypeFoldable}; use crate::ty::{self, ToPredicate, Ty, TyCtxt, TypeFoldable};
use rustc_span::Span;
use std::iter::once; use std::iter::once;
use syntax::symbol::{kw, Ident}; use syntax::symbol::{kw, Ident};
use syntax_pos::Span;
/// Returns the set of obligations needed to make `ty` well-formed. /// Returns the set of obligations needed to make `ty` well-formed.
/// If `ty` contains unresolved inference variables, this may include /// If `ty` contains unresolved inference variables, this may include

View file

@ -1,8 +1,8 @@
// These functions are used by macro expansion for bug! and span_bug! // These functions are used by macro expansion for bug! and span_bug!
use crate::ty::tls; use crate::ty::tls;
use rustc_span::{MultiSpan, Span};
use std::fmt; use std::fmt;
use syntax_pos::{MultiSpan, Span};
#[cold] #[cold]
#[inline(never)] #[inline(never)]

View file

@ -20,5 +20,5 @@ rustc_target = { path = "../librustc_target" }
smallvec = { version = "1.0", features = ["union", "may_dangle"] } smallvec = { version = "1.0", features = ["union", "may_dangle"] }
syntax = { path = "../libsyntax" } syntax = { path = "../libsyntax" }
rustc_expand = { path = "../librustc_expand" } rustc_expand = { path = "../librustc_expand" }
syntax_pos = { path = "../librustc_span", package = "rustc_span" } rustc_span = { path = "../librustc_span" }
rustc_error_codes = { path = "../librustc_error_codes" } rustc_error_codes = { path = "../librustc_error_codes" }

View file

@ -5,13 +5,13 @@ use State::*;
use errors::{DiagnosticBuilder, PResult}; use errors::{DiagnosticBuilder, PResult};
use rustc_expand::base::*; use rustc_expand::base::*;
use rustc_parse::parser::Parser; use rustc_parse::parser::Parser;
use rustc_span::Span;
use syntax::ast::{self, AsmDialect}; use syntax::ast::{self, AsmDialect};
use syntax::ptr::P; use syntax::ptr::P;
use syntax::symbol::{kw, sym, Symbol}; use syntax::symbol::{kw, sym, Symbol};
use syntax::token::{self, Token}; use syntax::token::{self, Token};
use syntax::tokenstream::{self, TokenStream}; use syntax::tokenstream::{self, TokenStream};
use syntax::{span_err, struct_span_err}; use syntax::{span_err, struct_span_err};
use syntax_pos::Span;
use rustc_error_codes::*; use rustc_error_codes::*;

View file

@ -2,13 +2,13 @@ use errors::{Applicability, DiagnosticBuilder};
use rustc_expand::base::*; use rustc_expand::base::*;
use rustc_parse::parser::Parser; use rustc_parse::parser::Parser;
use rustc_span::{Span, DUMMY_SP};
use syntax::ast::{self, *}; use syntax::ast::{self, *};
use syntax::print::pprust; use syntax::print::pprust;
use syntax::ptr::P; use syntax::ptr::P;
use syntax::symbol::{sym, Symbol}; use syntax::symbol::{sym, Symbol};
use syntax::token::{self, TokenKind}; use syntax::token::{self, TokenKind};
use syntax::tokenstream::{DelimSpan, TokenStream, TokenTree}; use syntax::tokenstream::{DelimSpan, TokenStream, TokenTree};
use syntax_pos::{Span, DUMMY_SP};
pub fn expand_assert<'cx>( pub fn expand_assert<'cx>(
cx: &'cx mut ExtCtxt<'_>, cx: &'cx mut ExtCtxt<'_>,

View file

@ -4,11 +4,11 @@
use errors::DiagnosticBuilder; use errors::DiagnosticBuilder;
use rustc_expand::base::{self, *}; use rustc_expand::base::{self, *};
use rustc_span::Span;
use syntax::ast; use syntax::ast;
use syntax::attr; use syntax::attr;
use syntax::token; use syntax::token;
use syntax::tokenstream::TokenStream; use syntax::tokenstream::TokenStream;
use syntax_pos::Span;
pub fn expand_cfg( pub fn expand_cfg(
cx: &mut ExtCtxt<'_>, cx: &mut ExtCtxt<'_>,

View file

@ -1,11 +1,11 @@
//! Attributes injected into the crate root from command line using `-Z crate-attr`. //! Attributes injected into the crate root from command line using `-Z crate-attr`.
use rustc_expand::panictry; use rustc_expand::panictry;
use rustc_span::FileName;
use syntax::ast::{self, AttrItem, AttrStyle}; use syntax::ast::{self, AttrItem, AttrStyle};
use syntax::attr::mk_attr; use syntax::attr::mk_attr;
use syntax::sess::ParseSess; use syntax::sess::ParseSess;
use syntax::token; use syntax::token;
use syntax_pos::FileName;
pub fn inject(mut krate: ast::Crate, parse_sess: &ParseSess, attrs: &[String]) -> ast::Crate { pub fn inject(mut krate: ast::Crate, parse_sess: &ParseSess, attrs: &[String]) -> ast::Crate {
for raw_attr in attrs { for raw_attr in attrs {

View file

@ -1,8 +1,8 @@
// The compiler code necessary to support the compile_error! extension. // The compiler code necessary to support the compile_error! extension.
use rustc_expand::base::{self, *}; use rustc_expand::base::{self, *};
use rustc_span::Span;
use syntax::tokenstream::TokenStream; use syntax::tokenstream::TokenStream;
use syntax_pos::Span;
pub fn expand_compile_error<'cx>( pub fn expand_compile_error<'cx>(
cx: &'cx mut ExtCtxt<'_>, cx: &'cx mut ExtCtxt<'_>,

View file

@ -7,7 +7,7 @@ use std::string::String;
pub fn expand_concat( pub fn expand_concat(
cx: &mut base::ExtCtxt<'_>, cx: &mut base::ExtCtxt<'_>,
sp: syntax_pos::Span, sp: rustc_span::Span,
tts: TokenStream, tts: TokenStream,
) -> Box<dyn base::MacResult + 'static> { ) -> Box<dyn base::MacResult + 'static> {
let es = match base::get_exprs_from_tts(cx, sp, tts) { let es = match base::get_exprs_from_tts(cx, sp, tts) {

View file

@ -1,10 +1,10 @@
use rustc_expand::base::{self, *}; use rustc_expand::base::{self, *};
use rustc_span::symbol::Symbol;
use rustc_span::Span;
use syntax::ast; use syntax::ast;
use syntax::ptr::P; use syntax::ptr::P;
use syntax::token::{self, Token}; use syntax::token::{self, Token};
use syntax::tokenstream::{TokenStream, TokenTree}; use syntax::tokenstream::{TokenStream, TokenTree};
use syntax_pos::symbol::Symbol;
use syntax_pos::Span;
pub fn expand_concat_idents<'cx>( pub fn expand_concat_idents<'cx>(
cx: &'cx mut ExtCtxt<'_>, cx: &'cx mut ExtCtxt<'_>,

View file

@ -3,8 +3,8 @@ use crate::deriving::generic::*;
use crate::deriving::path_std; use crate::deriving::path_std;
use rustc_expand::base::{Annotatable, ExtCtxt}; use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::Span;
use syntax::ast::MetaItem; use syntax::ast::MetaItem;
use syntax_pos::Span;
pub fn expand_deriving_copy( pub fn expand_deriving_copy(
cx: &mut ExtCtxt<'_>, cx: &mut ExtCtxt<'_>,

View file

@ -3,10 +3,10 @@ use crate::deriving::generic::*;
use crate::deriving::path_std; use crate::deriving::path_std;
use rustc_expand::base::{Annotatable, ExtCtxt}; use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::Span;
use syntax::ast::{self, Expr, GenericArg, Generics, ItemKind, MetaItem, VariantData}; use syntax::ast::{self, Expr, GenericArg, Generics, ItemKind, MetaItem, VariantData};
use syntax::ptr::P; use syntax::ptr::P;
use syntax::symbol::{kw, sym, Symbol}; use syntax::symbol::{kw, sym, Symbol};
use syntax_pos::Span;
pub fn expand_deriving_clone( pub fn expand_deriving_clone(
cx: &mut ExtCtxt<'_>, cx: &mut ExtCtxt<'_>,

View file

@ -3,10 +3,10 @@ use crate::deriving::generic::*;
use crate::deriving::path_std; use crate::deriving::path_std;
use rustc_expand::base::{Annotatable, ExtCtxt}; use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::Span;
use syntax::ast::{self, Expr, GenericArg, Ident, MetaItem}; use syntax::ast::{self, Expr, GenericArg, Ident, MetaItem};
use syntax::ptr::P; use syntax::ptr::P;
use syntax::symbol::{sym, Symbol}; use syntax::symbol::{sym, Symbol};
use syntax_pos::Span;
pub fn expand_deriving_eq( pub fn expand_deriving_eq(
cx: &mut ExtCtxt<'_>, cx: &mut ExtCtxt<'_>,

View file

@ -3,10 +3,10 @@ use crate::deriving::generic::*;
use crate::deriving::path_std; use crate::deriving::path_std;
use rustc_expand::base::{Annotatable, ExtCtxt}; use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::Span;
use syntax::ast::{self, Expr, MetaItem}; use syntax::ast::{self, Expr, MetaItem};
use syntax::ptr::P; use syntax::ptr::P;
use syntax::symbol::sym; use syntax::symbol::sym;
use syntax_pos::Span;
pub fn expand_deriving_ord( pub fn expand_deriving_ord(
cx: &mut ExtCtxt<'_>, cx: &mut ExtCtxt<'_>,

View file

@ -3,10 +3,10 @@ use crate::deriving::generic::*;
use crate::deriving::{path_local, path_std}; use crate::deriving::{path_local, path_std};
use rustc_expand::base::{Annotatable, ExtCtxt}; use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::Span;
use syntax::ast::{BinOpKind, Expr, MetaItem}; use syntax::ast::{BinOpKind, Expr, MetaItem};
use syntax::ptr::P; use syntax::ptr::P;
use syntax::symbol::sym; use syntax::symbol::sym;
use syntax_pos::Span;
pub fn expand_deriving_partial_eq( pub fn expand_deriving_partial_eq(
cx: &mut ExtCtxt<'_>, cx: &mut ExtCtxt<'_>,

View file

@ -5,10 +5,10 @@ use crate::deriving::generic::*;
use crate::deriving::{path_local, path_std, pathvec_std}; use crate::deriving::{path_local, path_std, pathvec_std};
use rustc_expand::base::{Annotatable, ExtCtxt}; use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::Span;
use syntax::ast::{self, BinOpKind, Expr, MetaItem}; use syntax::ast::{self, BinOpKind, Expr, MetaItem};
use syntax::ptr::P; use syntax::ptr::P;
use syntax::symbol::{sym, Symbol}; use syntax::symbol::{sym, Symbol};
use syntax_pos::Span;
pub fn expand_deriving_partial_ord( pub fn expand_deriving_partial_ord(
cx: &mut ExtCtxt<'_>, cx: &mut ExtCtxt<'_>,

View file

@ -3,11 +3,11 @@ use crate::deriving::generic::*;
use crate::deriving::path_std; use crate::deriving::path_std;
use rustc_expand::base::{Annotatable, ExtCtxt}; use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::{Span, DUMMY_SP};
use syntax::ast::{self, Ident}; use syntax::ast::{self, Ident};
use syntax::ast::{Expr, MetaItem}; use syntax::ast::{Expr, MetaItem};
use syntax::ptr::P; use syntax::ptr::P;
use syntax::symbol::sym; use syntax::symbol::sym;
use syntax_pos::{Span, DUMMY_SP};
pub fn expand_deriving_debug( pub fn expand_deriving_debug(
cx: &mut ExtCtxt<'_>, cx: &mut ExtCtxt<'_>,

View file

@ -5,11 +5,11 @@ use crate::deriving::generic::*;
use crate::deriving::pathvec_std; use crate::deriving::pathvec_std;
use rustc_expand::base::{Annotatable, ExtCtxt}; use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::Span;
use syntax::ast; use syntax::ast;
use syntax::ast::{Expr, MetaItem, Mutability}; use syntax::ast::{Expr, MetaItem, Mutability};
use syntax::ptr::P; use syntax::ptr::P;
use syntax::symbol::Symbol; use syntax::symbol::Symbol;
use syntax_pos::Span;
pub fn expand_deriving_rustc_decodable( pub fn expand_deriving_rustc_decodable(
cx: &mut ExtCtxt<'_>, cx: &mut ExtCtxt<'_>,

View file

@ -3,11 +3,11 @@ use crate::deriving::generic::*;
use crate::deriving::path_std; use crate::deriving::path_std;
use rustc_expand::base::{Annotatable, DummyResult, ExtCtxt}; use rustc_expand::base::{Annotatable, DummyResult, ExtCtxt};
use rustc_span::Span;
use syntax::ast::{Expr, MetaItem}; use syntax::ast::{Expr, MetaItem};
use syntax::ptr::P; use syntax::ptr::P;
use syntax::span_err; use syntax::span_err;
use syntax::symbol::{kw, sym}; use syntax::symbol::{kw, sym};
use syntax_pos::Span;
use rustc_error_codes::*; use rustc_error_codes::*;

View file

@ -90,10 +90,10 @@ use crate::deriving::generic::*;
use crate::deriving::pathvec_std; use crate::deriving::pathvec_std;
use rustc_expand::base::{Annotatable, ExtCtxt}; use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::Span;
use syntax::ast::{Expr, ExprKind, MetaItem, Mutability}; use syntax::ast::{Expr, ExprKind, MetaItem, Mutability};
use syntax::ptr::P; use syntax::ptr::P;
use syntax::symbol::Symbol; use syntax::symbol::Symbol;
use syntax_pos::Span;
pub fn expand_deriving_rustc_encodable( pub fn expand_deriving_rustc_encodable(
cx: &mut ExtCtxt<'_>, cx: &mut ExtCtxt<'_>,

View file

@ -182,6 +182,7 @@ use std::iter;
use std::vec; use std::vec;
use rustc_expand::base::{Annotatable, ExtCtxt}; use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::Span;
use syntax::ast::{self, BinOpKind, EnumDef, Expr, Generics, Ident, PatKind}; use syntax::ast::{self, BinOpKind, EnumDef, Expr, Generics, Ident, PatKind};
use syntax::ast::{GenericArg, GenericParamKind, VariantData}; use syntax::ast::{GenericArg, GenericParamKind, VariantData};
use syntax::attr; use syntax::attr;
@ -190,7 +191,6 @@ use syntax::sess::ParseSess;
use syntax::source_map::respan; use syntax::source_map::respan;
use syntax::symbol::{kw, sym, Symbol}; use syntax::symbol::{kw, sym, Symbol};
use syntax::util::map_in_place::MapInPlace; use syntax::util::map_in_place::MapInPlace;
use syntax_pos::Span;
use ty::{LifetimeBounds, Path, Ptr, PtrTy, Self_, Ty}; use ty::{LifetimeBounds, Path, Ptr, PtrTy, Self_, Ty};

View file

@ -5,11 +5,11 @@ pub use PtrTy::*;
pub use Ty::*; pub use Ty::*;
use rustc_expand::base::ExtCtxt; use rustc_expand::base::ExtCtxt;
use rustc_span::symbol::kw;
use rustc_span::Span;
use syntax::ast::{self, Expr, GenericArg, GenericParamKind, Generics, Ident, SelfKind}; use syntax::ast::{self, Expr, GenericArg, GenericParamKind, Generics, Ident, SelfKind};
use syntax::ptr::P; use syntax::ptr::P;
use syntax::source_map::{respan, DUMMY_SP}; use syntax::source_map::{respan, DUMMY_SP};
use syntax_pos::symbol::kw;
use syntax_pos::Span;
/// The types of pointers /// The types of pointers
#[derive(Clone)] #[derive(Clone)]

View file

@ -3,10 +3,10 @@ use crate::deriving::generic::*;
use crate::deriving::{self, path_std, pathvec_std}; use crate::deriving::{self, path_std, pathvec_std};
use rustc_expand::base::{Annotatable, ExtCtxt}; use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::Span;
use syntax::ast::{Expr, MetaItem, Mutability}; use syntax::ast::{Expr, MetaItem, Mutability};
use syntax::ptr::P; use syntax::ptr::P;
use syntax::symbol::sym; use syntax::symbol::sym;
use syntax_pos::Span;
pub fn expand_deriving_hash( pub fn expand_deriving_hash(
cx: &mut ExtCtxt<'_>, cx: &mut ExtCtxt<'_>,

View file

@ -1,10 +1,10 @@
//! The compiler code necessary to implement the `#[derive]` extensions. //! The compiler code necessary to implement the `#[derive]` extensions.
use rustc_expand::base::{Annotatable, ExtCtxt, MultiItemModifier}; use rustc_expand::base::{Annotatable, ExtCtxt, MultiItemModifier};
use rustc_span::Span;
use syntax::ast::{self, ItemKind, MetaItem}; use syntax::ast::{self, ItemKind, MetaItem};
use syntax::ptr::P; use syntax::ptr::P;
use syntax::symbol::{sym, Symbol}; use syntax::symbol::{sym, Symbol};
use syntax_pos::Span;
macro path_local($x:ident) { macro path_local($x:ident) {
generic::ty::Path::new_local(stringify!($x)) generic::ty::Path::new_local(stringify!($x))

View file

@ -4,10 +4,10 @@
// //
use rustc_expand::base::{self, *}; use rustc_expand::base::{self, *};
use rustc_span::Span;
use syntax::ast::{self, GenericArg, Ident}; use syntax::ast::{self, GenericArg, Ident};
use syntax::symbol::{kw, sym, Symbol}; use syntax::symbol::{kw, sym, Symbol};
use syntax::tokenstream::TokenStream; use syntax::tokenstream::TokenStream;
use syntax_pos::Span;
use std::env; use std::env;

View file

@ -8,12 +8,12 @@ use errors::Applicability;
use errors::DiagnosticBuilder; use errors::DiagnosticBuilder;
use rustc_expand::base::{self, *}; use rustc_expand::base::{self, *};
use rustc_span::{MultiSpan, Span};
use syntax::ast; use syntax::ast;
use syntax::ptr::P; use syntax::ptr::P;
use syntax::symbol::{sym, Symbol}; use syntax::symbol::{sym, Symbol};
use syntax::token; use syntax::token;
use syntax::tokenstream::TokenStream; use syntax::tokenstream::TokenStream;
use syntax_pos::{MultiSpan, Span};
use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use std::borrow::Cow; use std::borrow::Cow;

View file

@ -1,6 +1,6 @@
pub mod printf { pub mod printf {
use super::strcursor::StrCursor as Cur; use super::strcursor::StrCursor as Cur;
use syntax_pos::InnerSpan; use rustc_span::InnerSpan;
/// Represents a single `printf`-style substitution. /// Represents a single `printf`-style substitution.
#[derive(Clone, PartialEq, Debug)] #[derive(Clone, PartialEq, Debug)]
@ -604,7 +604,7 @@ pub mod printf {
pub mod shell { pub mod shell {
use super::strcursor::StrCursor as Cur; use super::strcursor::StrCursor as Cur;
use syntax_pos::InnerSpan; use rustc_span::InnerSpan;
#[derive(Clone, PartialEq, Debug)] #[derive(Clone, PartialEq, Debug)]
pub enum Substitution<'a> { pub enum Substitution<'a> {

View file

@ -37,7 +37,7 @@ fn test_parse() {
precision: $prec, precision: $prec,
length: $len, length: $len,
type_: $type_, type_: $type_,
position: syntax_pos::InnerSpan::new($pos.0, $pos.1), position: rustc_span::InnerSpan::new($pos.0, $pos.1),
}), }),
"!" "!"
)) ))

View file

@ -1,12 +1,12 @@
use crate::util::check_builtin_macro_attribute; use crate::util::check_builtin_macro_attribute;
use rustc_expand::base::{Annotatable, ExtCtxt}; use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::Span;
use syntax::ast::{self, Attribute, Expr, FnHeader, FnSig, Generics, Ident, Param}; use syntax::ast::{self, Attribute, Expr, FnHeader, FnSig, Generics, Ident, Param};
use syntax::ast::{ItemKind, Mutability, Stmt, Ty, TyKind, Unsafety}; use syntax::ast::{ItemKind, Mutability, Stmt, Ty, TyKind, Unsafety};
use syntax::expand::allocator::{AllocatorKind, AllocatorMethod, AllocatorTy, ALLOCATOR_METHODS}; use syntax::expand::allocator::{AllocatorKind, AllocatorMethod, AllocatorTy, ALLOCATOR_METHODS};
use syntax::ptr::P; use syntax::ptr::P;
use syntax::symbol::{kw, sym, Symbol}; use syntax::symbol::{kw, sym, Symbol};
use syntax_pos::Span;
pub fn expand( pub fn expand(
ecx: &mut ExtCtxt<'_>, ecx: &mut ExtCtxt<'_>,

View file

@ -10,13 +10,13 @@
use errors::DiagnosticBuilder; use errors::DiagnosticBuilder;
use rustc_expand::base::{self, *}; use rustc_expand::base::{self, *};
use rustc_span::Span;
use smallvec::smallvec; use smallvec::smallvec;
use syntax::ast; use syntax::ast;
use syntax::ptr::P; use syntax::ptr::P;
use syntax::source_map::respan; use syntax::source_map::respan;
use syntax::token; use syntax::token;
use syntax::tokenstream::TokenStream; use syntax::tokenstream::TokenStream;
use syntax_pos::Span;
pub fn expand_global_asm<'cx>( pub fn expand_global_asm<'cx>(
cx: &'cx mut ExtCtxt<'_>, cx: &'cx mut ExtCtxt<'_>,

View file

@ -1,11 +1,11 @@
use rustc_expand::base; use rustc_expand::base;
use rustc_span;
use syntax::print; use syntax::print;
use syntax::tokenstream::TokenStream; use syntax::tokenstream::TokenStream;
use syntax_pos;
pub fn expand_log_syntax<'cx>( pub fn expand_log_syntax<'cx>(
_cx: &'cx mut base::ExtCtxt<'_>, _cx: &'cx mut base::ExtCtxt<'_>,
sp: syntax_pos::Span, sp: rustc_span::Span,
tts: TokenStream, tts: TokenStream,
) -> Box<dyn base::MacResult + 'cx> { ) -> Box<dyn base::MacResult + 'cx> {
println!("{}", print::pprust::tts_to_string(tts)); println!("{}", print::pprust::tts_to_string(tts));

Some files were not shown because too many files have changed in this diff Show more