Auto merge of #67763 - petrochenkov:crateren2, r=Centril

Rename `syntax_pos` to `rustc_span` in source code

Follow-up to https://github.com/rust-lang/rust/pull/67707.

r? @Centril
This commit is contained in:
bors
2020-01-01 08:39:44 +00:00
383 changed files with 601 additions and 601 deletions
+1 -1
View File
@@ -9,5 +9,5 @@ name = "fmt_macros"
path = "lib.rs"
[dependencies]
syntax_pos = { path = "../librustc_span", package = "rustc_span" }
rustc_span = { path = "../librustc_span" }
rustc_lexer = { path = "../librustc_lexer" }
+1 -1
View File
@@ -24,7 +24,7 @@
use std::str;
use std::string;
use syntax_pos::{InnerSpan, Symbol};
use rustc_span::{InnerSpan, Symbol};
#[derive(Copy, Clone)]
struct InnerOffset(usize);
+1 -1
View File
@@ -144,7 +144,7 @@ fn format_align_fill() {
}
#[test]
fn format_counts() {
use syntax_pos::{edition, Globals, GLOBALS};
use rustc_span::{edition, Globals, GLOBALS};
GLOBALS.set(&Globals::new(edition::DEFAULT_EDITION), || {
same(
"{:10x}",
+1 -1
View File
@@ -30,7 +30,7 @@ rustc_index = { path = "../librustc_index" }
errors = { path = "../librustc_errors", package = "rustc_errors" }
rustc_serialize = { path = "../libserialize", package = "serialize" }
syntax = { path = "../libsyntax" }
syntax_pos = { path = "../librustc_span", package = "rustc_span" }
rustc_span = { path = "../librustc_span" }
backtrace = "0.3.40"
parking_lot = "0.9"
byteorder = { version = "1.3" }
+1 -1
View File
@@ -65,9 +65,9 @@
use crate::ty::subst::SubstsRef;
use crate::ty::{self, ParamEnvAnd, Ty, TyCtxt};
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_span::symbol::Symbol;
use std::fmt;
use std::hash::Hash;
use syntax_pos::symbol::Symbol;
// 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
+1 -1
View File
@@ -12,9 +12,9 @@
use crate::ty::query::Providers;
use crate::ty::TyCtxt;
use rustc_span::Span;
use std::fmt::{self, Display};
use syntax::{attr, symbol::sym};
use syntax_pos::Span;
use rustc_error_codes::*;
+2 -2
View File
@@ -6,10 +6,10 @@
use crate::util::nodemap::DefIdMap;
use rustc_macros::HashStable;
use rustc_span::hygiene::MacroKind;
use rustc_span::Span;
use syntax::ast;
use syntax::ast::NodeId;
use syntax_pos::hygiene::MacroKind;
use syntax_pos::Span;
use std::fmt::Debug;
+1 -1
View File
@@ -36,8 +36,8 @@
use crate::hir::map::Map;
use crate::hir::*;
use rustc_span::Span;
use syntax::ast::{Attribute, Ident, Name};
use syntax_pos::Span;
#[derive(Copy, Clone)]
pub enum FnKind<'a> {
+1 -1
View File
@@ -15,8 +15,8 @@
use crate::hir::intravisit::FnKind;
use crate::hir::map;
use crate::hir::{Expr, FnDecl, Node};
use rustc_span::Span;
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
/// and a body (as well as a NodeId, a span, etc).
+1 -1
View File
@@ -11,10 +11,10 @@
use crate::util::nodemap::FxHashMap;
use rustc_data_structures::svh::Svh;
use rustc_index::vec::IndexVec;
use rustc_span::Span;
use std::iter::repeat;
use syntax::ast::NodeId;
use syntax::source_map::SourceMap;
use syntax_pos::Span;
use crate::ich::StableHashingContext;
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
+3 -3
View File
@@ -13,13 +13,13 @@
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::stable_hasher::StableHasher;
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::fmt::Write;
use std::hash::Hash;
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.
/// Internally the `DefPathTable` holds a tree of `DefKey`s, where each `DefKey`
+2 -2
View File
@@ -16,11 +16,11 @@
use rustc_data_structures::svh::Svh;
use rustc_index::vec::IndexVec;
use rustc_span::hygiene::MacroKind;
use rustc_span::{Span, DUMMY_SP};
use rustc_target::spec::abi::Abi;
use syntax::ast::{self, Name, NodeId};
use syntax::source_map::Spanned;
use syntax_pos::hygiene::MacroKind;
use syntax_pos::{Span, DUMMY_SP};
pub mod blocks;
mod collector;
+3 -3
View File
@@ -19,6 +19,9 @@
use rustc_data_structures::sync::{par_for_each_in, Send, Sync};
use rustc_macros::HashStable;
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 smallvec::SmallVec;
use std::collections::{BTreeMap, BTreeSet};
@@ -30,9 +33,6 @@
use syntax::attr::{InlineAttr, OptimizeAttr};
use syntax::tokenstream::TokenStream;
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 def;
+1 -1
View File
@@ -1,8 +1,8 @@
use crate::hir::def::{CtorOf, DefKind, Res};
use crate::hir::def_id::DefId;
use crate::hir::{self, HirId, PatKind};
use rustc_span::Span;
use syntax::ast;
use syntax_pos::Span;
use std::iter::{Enumerate, ExactSizeIterator};
+14 -14
View File
@@ -1,3 +1,4 @@
use rustc_span::{self, BytePos, FileName};
use rustc_target::spec::abi::Abi;
use syntax::ast;
use syntax::print::pp::Breaks::{Consistent, Inconsistent};
@@ -7,7 +8,6 @@
use syntax::source_map::{SourceMap, Spanned};
use syntax::symbol::kw;
use syntax::util::parser::{self, AssocOp, Fixity};
use syntax_pos::{self, BytePos, FileName};
use crate::hir;
use crate::hir::{GenericArg, GenericParam, GenericParamKind};
@@ -178,7 +178,7 @@ pub fn bopen(&mut self) {
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.break_offset_if_not_bol(1, -(INDENT_UNIT as isize));
self.s.word("}");
@@ -187,7 +187,7 @@ pub fn bclose_maybe_open(&mut self, span: syntax_pos::Span, close_box: bool) {
}
}
pub fn bclose(&mut self, span: syntax_pos::Span) {
pub fn bclose(&mut self, span: rustc_span::Span) {
self.bclose_maybe_open(span, true)
}
@@ -223,7 +223,7 @@ pub fn synth_comment(&mut self, text: String) {
pub fn commasep_cmnt<T, F, G>(&mut self, b: Breaks, elts: &[T], mut op: F, mut get_span: G)
where
F: FnMut(&mut State<'_>, &T),
G: FnMut(&T) -> syntax_pos::Span,
G: FnMut(&T) -> rustc_span::Span,
{
self.rbox(0, b);
let len = elts.len();
@@ -704,7 +704,7 @@ pub fn print_enum_def(
enum_definition: &hir::EnumDef<'_>,
generics: &hir::Generics<'_>,
name: ast::Name,
span: syntax_pos::Span,
span: rustc_span::Span,
visibility: &hir::Visibility<'_>,
) {
self.head(visibility_qualified(visibility, "enum"));
@@ -715,7 +715,7 @@ pub fn print_enum_def(
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();
for v in variants {
self.space_if_not_bol();
@@ -763,7 +763,7 @@ pub fn print_struct(
struct_def: &hir::VariantData<'_>,
generics: &hir::Generics<'_>,
name: ast::Name,
span: syntax_pos::Span,
span: rustc_span::Span,
print_finalizer: bool,
) {
self.print_name(name);
@@ -839,18 +839,18 @@ pub fn print_trait_item(&mut self, ti: &hir::TraitItem<'_>) {
match ti.kind {
hir::TraitItemKind::Const(ref ty, default) => {
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);
}
hir::TraitItemKind::Method(ref sig, hir::TraitMethod::Required(ref arg_names)) => {
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.s.word(";");
}
hir::TraitItemKind::Method(ref sig, hir::TraitMethod::Provided(body)) => {
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.print_method_sig(ti.ident, sig, &ti.generics, &vis, &[], Some(body));
self.nbsp();
@@ -2097,8 +2097,8 @@ pub fn print_ty_fn(
}
let generics = hir::Generics {
params: &[],
where_clause: hir::WhereClause { predicates: &[], span: syntax_pos::DUMMY_SP },
span: syntax_pos::DUMMY_SP,
where_clause: hir::WhereClause { predicates: &[], span: rustc_span::DUMMY_SP },
span: rustc_span::DUMMY_SP,
};
self.print_fn(
decl,
@@ -2110,7 +2110,7 @@ pub fn print_ty_fn(
},
name,
&generics,
&Spanned { span: syntax_pos::DUMMY_SP, node: hir::VisibilityKind::Inherited },
&Spanned { span: rustc_span::DUMMY_SP, node: hir::VisibilityKind::Inherited },
arg_names,
None,
);
@@ -2119,7 +2119,7 @@ pub fn print_ty_fn(
pub fn maybe_print_trailing_comment(
&mut self,
span: syntax_pos::Span,
span: rustc_span::Span,
next_pos: Option<BytePos>,
) {
if let Some(cmnts) = self.comments() {
+1 -1
View File
@@ -6,7 +6,7 @@
use crate::ty::query::Providers;
use crate::ty::TyCtxt;
use rustc_data_structures::fx::{FxHashSet, FxIndexMap};
use syntax_pos::Span;
use rustc_span::Span;
pub fn provide(providers: &mut Providers<'_>) {
providers.upvars = |tcx, def_id| {
+2 -2
View File
@@ -9,10 +9,10 @@
use std::cmp::Ord;
use rustc_span::{BytePos, SourceFile};
use syntax::ast;
use syntax::source_map::SourceMap;
use syntax::symbol::Symbol;
use syntax_pos::{BytePos, SourceFile};
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_data_structures::stable_hasher::{HashStable, StableHasher, ToStableHashKey};
@@ -270,7 +270,7 @@ fn to_stable_hash_key(
}
}
impl<'a> syntax_pos::HashStableContext for StableHashingContext<'a> {
impl<'a> rustc_span::HashStableContext for StableHashingContext<'a> {
fn hash_spans(&self) -> bool {
self.hash_spans
}
+10 -10
View File
@@ -3,8 +3,8 @@
use crate::ich::StableHashingContext;
use rustc_span::SourceFile;
use syntax::ast;
use syntax_pos::SourceFile;
use crate::hir::def_id::{CrateNum, DefId, CRATE_DEF_INDEX};
@@ -114,22 +114,22 @@ fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHas
}
}
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
}
fn stable_multibyte_char(
mbc: ::syntax_pos::MultiByteChar,
source_file_start: ::syntax_pos::BytePos,
mbc: ::rustc_span::MultiByteChar,
source_file_start: ::rustc_span::BytePos,
) -> (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)
}
fn stable_non_narrow_char(
swc: ::syntax_pos::NonNarrowChar,
source_file_start: ::syntax_pos::BytePos,
swc: ::rustc_span::NonNarrowChar,
source_file_start: ::rustc_span::BytePos,
) -> (u32, u32) {
let pos = swc.pos();
let width = swc.width();
@@ -138,10 +138,10 @@ fn stable_non_narrow_char(
}
fn stable_normalized_pos(
np: ::syntax_pos::NormalizedPos,
source_file_start: ::syntax_pos::BytePos,
np: ::rustc_span::NormalizedPos,
source_file_start: ::rustc_span::BytePos,
) -> (u32, u32) {
let ::syntax_pos::NormalizedPos { pos, diff } = np;
let ::rustc_span::NormalizedPos { pos, diff } = np;
(pos.0 - source_file_start.0, diff)
}
+1 -1
View File
@@ -4,8 +4,8 @@
hash_stable_trait_impls, NodeIdHashingMode, StableHashingContext, StableHashingContextProvider,
};
crate use rustc_data_structures::fingerprint::Fingerprint;
pub use rustc_span::CachingSourceMapView;
use syntax::symbol::{sym, Symbol};
pub use syntax_pos::CachingSourceMapView;
mod hcx;
@@ -190,7 +190,7 @@ fn canonicalize_free_region(
// `delay_span_bug` to allow type error over an ICE.
ty::tls::with_context(|c| {
c.tcx.sess.delay_span_bug(
syntax_pos::DUMMY_SP,
rustc_span::DUMMY_SP,
&format!("unexpected region in query response: `{:?}`", r),
);
});
@@ -25,8 +25,8 @@
use crate::util::captures::Captures;
use rustc_index::vec::Idx;
use rustc_index::vec::IndexVec;
use rustc_span::DUMMY_SP;
use std::fmt::Debug;
use syntax_pos::DUMMY_SP;
impl<'tcx> InferCtxtBuilder<'tcx> {
/// The "main method" for a canonicalized trait query. Given the
+1 -1
View File
@@ -40,8 +40,8 @@
use crate::ty::{self, InferConst, Ty, TyCtxt};
use crate::ty::{IntType, UintType};
use rustc_span::{Span, DUMMY_SP};
use syntax::ast;
use syntax_pos::{Span, DUMMY_SP};
#[derive(Clone)]
pub struct CombineFields<'infcx, 'tcx> {
+1 -1
View File
@@ -67,9 +67,9 @@
use errors::{Applicability, DiagnosticBuilder, DiagnosticStyledString};
use rustc_error_codes::*;
use rustc_span::{Pos, Span};
use rustc_target::spec::abi;
use std::{cmp, fmt};
use syntax_pos::{Pos, Span};
mod note;
@@ -6,10 +6,10 @@
use crate::ty::print::Print;
use crate::ty::{self, DefIdTree, Infer, Ty, TyVar};
use errors::{Applicability, DiagnosticBuilder};
use rustc_span::Span;
use std::borrow::Cow;
use syntax::source_map::DesugaringKind;
use syntax::symbol::kw;
use syntax_pos::Span;
use rustc_error_codes::*;
@@ -6,7 +6,7 @@
use crate::traits::ObligationCauseCode::CompareImplMethodObligation;
use crate::ty::Ty;
use crate::util::common::ErrorReported;
use syntax_pos::Span;
use rustc_span::Span;
impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
/// Print the error message for lifetime errors when the `impl` doesn't conform to the `trait`.
@@ -5,7 +5,7 @@
use crate::hir::def_id::DefId;
use crate::infer::error_reporting::nice_region_error::NiceRegionError;
use crate::ty::{self, DefIdTree, Region, Ty};
use syntax_pos::Span;
use rustc_span::Span;
// The struct contains the information about the anonymous region
// we are searching for.
@@ -21,8 +21,8 @@
};
use rustc_index::bit_set::BitSet;
use rustc_index::vec::{Idx, IndexVec};
use rustc_span::Span;
use std::fmt;
use syntax_pos::Span;
mod graphviz;
+3 -3
View File
@@ -27,12 +27,12 @@
use errors::DiagnosticBuilder;
use rustc_data_structures::sync::Lrc;
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::collections::BTreeMap;
use std::fmt;
use syntax::ast;
use syntax_pos::symbol::Symbol;
use syntax_pos::Span;
use self::combine::CombineFields;
use self::lexical_region_resolve::LexicalRegionResolutions;
@@ -1728,7 +1728,7 @@ pub fn span(&self) -> Span {
Coercion(a) => a,
EarlyBoundRegion(a, ..) => a,
LateBoundRegion(a, ..) => a,
BoundRegionInCoherence(_) => syntax_pos::DUMMY_SP,
BoundRegionInCoherence(_) => rustc_span::DUMMY_SP,
UpvarRegion(_, a) => a,
NLL(..) => bug!("NLL variable used with `span`"),
}
+1 -1
View File
@@ -266,7 +266,7 @@ fn relate_projection_ty(
) -> Ty<'tcx> {
use crate::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
use crate::traits::WhereClause;
use syntax_pos::DUMMY_SP;
use rustc_span::DUMMY_SP;
match value_ty.kind {
ty::Projection(other_projection_ty) => {
+1 -1
View File
@@ -13,7 +13,7 @@
use rustc::session::config::nightly_options;
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::sync::Lrc;
use syntax_pos::Span;
use rustc_span::Span;
use rustc_error_codes::*;
+1 -1
View File
@@ -4,7 +4,7 @@
use crate::traits::query::outlives_bounds::{self, OutlivesBound};
use crate::ty::{self, Ty};
use rustc_data_structures::fx::FxHashMap;
use syntax_pos::Span;
use rustc_span::Span;
/// The `OutlivesEnvironment` collects information about what outlives
/// what in a given type-checking setting. For example, if we have a
+1 -1
View File
@@ -15,7 +15,7 @@
use rustc_data_structures::sync::Lrc;
use rustc_data_structures::unify as ut;
use rustc_index::vec::IndexVec;
use syntax_pos::Span;
use rustc_span::Span;
use std::collections::BTreeMap;
use std::ops::Range;
+1 -1
View File
@@ -1,7 +1,7 @@
use crate::hir::def_id::DefId;
use crate::ty::{self, Ty, TyVid};
use rustc_span::Span;
use syntax::symbol::Symbol;
use syntax_pos::Span;
use rustc_data_structures::snapshot_vec as sv;
use rustc_data_structures::unify as ut;
+1 -1
View File
@@ -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::{Span, DUMMY_SP};
use syntax::symbol::Symbol;
use syntax_pos::{Span, DUMMY_SP};
use std::cell::RefMut;
use std::cmp;
+1 -1
View File
@@ -34,11 +34,11 @@
use errors::DiagnosticBuilder;
use rustc_data_structures::sync::{self, join, par_iter, ParallelIterator};
use rustc_span::{symbol::Symbol, MultiSpan, Span};
use std::slice;
use syntax::ast;
use syntax::util::lev_distance::find_best_match_for_name;
use syntax::visit as ast_visit;
use syntax_pos::{symbol::Symbol, MultiSpan, Span};
use rustc_error_codes::*;
+2 -2
View File
@@ -32,11 +32,11 @@
use crate::ty::TyCtxt;
use crate::util::nodemap::NodeMap;
use errors::{DiagnosticBuilder, DiagnosticId};
use rustc_span::hygiene::MacroKind;
use rustc_span::Span;
use syntax::ast;
use syntax::source_map::{DesugaringKind, ExpnKind, MultiSpan};
use syntax::symbol::Symbol;
use syntax_pos::hygiene::MacroKind;
use syntax_pos::Span;
pub use crate::lint::context::{
check_ast_crate, check_crate, late_lint_mod, BufferedEarlyLint, CheckLintNameResult,
+1 -1
View File
@@ -12,13 +12,13 @@
use rustc_data_structures::sync::{self, MetadataRef};
use rustc_macros::HashStable;
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;
use syntax_pos::Span;
pub use self::NativeLibraryKind::*;
pub use rustc_session::utils::NativeLibraryKind;
+1 -1
View File
@@ -19,9 +19,9 @@
use crate::hir;
use crate::hir::itemlikevisit::ItemLikeVisitor;
use rustc_macros::HashStable;
use rustc_span::Span;
use syntax::ast;
use syntax::symbol::{sym, Symbol};
use syntax_pos::Span;
use rustc_error_codes::*;
+1 -1
View File
@@ -16,7 +16,7 @@
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_index::vec::Idx;
use rustc_macros::HashStable;
use syntax_pos::{Span, DUMMY_SP};
use rustc_span::{Span, DUMMY_SP};
use std::fmt;
+1 -1
View File
@@ -16,12 +16,12 @@
use crate::util::nodemap::{FxHashMap, FxHashSet};
use errors::DiagnosticBuilder;
use rustc_feature::GateIssue;
use rustc_span::{MultiSpan, Span};
use syntax::ast::{Attribute, CRATE_NODE_ID};
use syntax::attr::{self, ConstStability, Deprecation, RustcDeprecation, Stability};
use syntax::errors::Applicability;
use syntax::feature_gate::{feature_err, feature_err_issue};
use syntax::symbol::{sym, Symbol};
use syntax_pos::{MultiSpan, Span};
use std::cmp::Ordering;
use std::mem::replace;
+1 -1
View File
@@ -9,10 +9,10 @@
use crate::hir::intravisit::{NestedVisitorMap, Visitor};
use crate::ty::TyCtxt;
use rustc_data_structures::fx::FxHashSet;
use rustc_span::Span;
use rustc_target::spec::PanicStrategy;
use syntax::ast;
use syntax::symbol::{sym, Symbol};
use syntax_pos::Span;
use rustc_error_codes::*;
+1 -1
View File
@@ -11,10 +11,10 @@
use errors::DiagnosticBuilder;
use hir::GeneratorKind;
use rustc_macros::HashStable;
use rustc_span::{Pos, Span};
use rustc_target::spec::abi::Abi;
use std::{any::Any, env, fmt};
use syntax::symbol::Symbol;
use syntax_pos::{Pos, Span};
use rustc_error_codes::*;
+1 -1
View File
@@ -4,7 +4,7 @@
use crate::mir;
use crate::ty::subst::{InternalSubsts, SubstsRef};
use crate::ty::{self, TyCtxt};
use syntax_pos::Span;
use rustc_span::Span;
impl<'tcx> TyCtxt<'tcx> {
/// Evaluates a constant without providing any substitutions. This is useful to evaluate consts
+1 -1
View File
@@ -27,6 +27,7 @@
use rustc_index::vec::{Idx, IndexVec};
use rustc_macros::HashStable;
use rustc_serialize::{Decodable, Encodable};
use rustc_span::{Span, DUMMY_SP};
use smallvec::SmallVec;
use std::borrow::Cow;
use std::fmt::{self, Debug, Display, Formatter, Write};
@@ -36,7 +37,6 @@
pub use syntax::ast::Mutability;
use syntax::ast::Name;
use syntax::symbol::Symbol;
use syntax_pos::{Span, DUMMY_SP};
pub use crate::mir::cache::{BodyAndCache, ReadOnlyBodyAndCache};
pub use crate::mir::interpret::AssertMessage;
+1 -1
View File
@@ -1,7 +1,7 @@
use crate::mir::*;
use crate::ty::subst::SubstsRef;
use crate::ty::{CanonicalUserTypeAnnotation, Ty};
use syntax_pos::Span;
use rustc_span::Span;
// # The MIR Visitor
//
+2 -2
View File
@@ -13,8 +13,8 @@
use crate::ty::subst::SubstsRef;
use crate::ty::{self, ParamEnvAnd, Ty, TyCtxt};
use rustc_span::symbol::Symbol;
use std::borrow::Cow;
use syntax_pos::symbol::Symbol;
// Each of these queries corresponds to a function pointer field in the
// `Providers` struct for requesting a value of that type, and a method
@@ -497,7 +497,7 @@
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
desc { "get a &core::panic::Location referring to a span" }
}
+1 -1
View File
@@ -12,8 +12,8 @@
use crate::ty::fold::TypeFoldable;
use crate::ty::subst::Subst;
use crate::ty::{self, Ty, TyCtxt};
use rustc_span::DUMMY_SP;
use syntax::symbol::sym;
use syntax_pos::DUMMY_SP;
/// Whether we do the orphan check relative to this crate or
/// to some remote crate.
+2 -2
View File
@@ -25,11 +25,11 @@
use errors::{pluralize, Applicability, DiagnosticBuilder, Style};
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 syntax::ast;
use syntax::symbol::{kw, sym};
use syntax_pos::source_map::SourceMap;
use syntax_pos::{ExpnKind, MultiSpan, Span, DUMMY_SP};
use rustc_error_codes::*;
+1 -1
View File
@@ -32,8 +32,8 @@
use crate::util::common::ErrorReported;
use chalk_engine;
use rustc_macros::HashStable;
use rustc_span::{Span, DUMMY_SP};
use syntax::ast;
use syntax_pos::{Span, DUMMY_SP};
use std::fmt::Debug;
use std::rc::Rc;
+1 -1
View File
@@ -16,11 +16,11 @@
use crate::traits::{self, Obligation, ObligationCause};
use crate::ty::subst::{InternalSubsts, Subst};
use crate::ty::{self, Predicate, ToPredicate, Ty, TyCtxt, TypeFoldable};
use rustc_span::{Span, DUMMY_SP};
use std::borrow::Cow;
use std::iter::{self};
use syntax::ast::{self};
use syntax::symbol::Symbol;
use syntax_pos::{Span, DUMMY_SP};
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
pub enum ObjectSafetyViolation {
+1 -1
View File
@@ -5,10 +5,10 @@
use crate::util::common::ErrorReported;
use crate::util::nodemap::FxHashMap;
use rustc_span::Span;
use syntax::ast::{MetaItem, NestedMetaItem};
use syntax::attr;
use syntax::symbol::{kw, sym, Symbol};
use syntax_pos::Span;
use rustc_error_codes::*;
+1 -1
View File
@@ -21,9 +21,9 @@
use crate::util::common::FN_OUTPUT_NAME;
use rustc_data_structures::snapshot_map::{Snapshot, SnapshotMap};
use rustc_macros::HashStable;
use rustc_span::DUMMY_SP;
use syntax::ast::Ident;
use syntax::symbol::sym;
use syntax_pos::DUMMY_SP;
/// Depending on the stage of compilation, we want projection to be
/// more or less conservative.
+1 -1
View File
@@ -19,7 +19,7 @@
use crate::ty::subst::{InternalSubsts, Subst, SubstsRef};
use crate::ty::{self, TyCtxt, TypeFoldable};
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::{FulfillmentContext, SelectionContext};
+1 -1
View File
@@ -1,6 +1,6 @@
use errors::DiagnosticBuilder;
use rustc_span::Span;
use smallvec::SmallVec;
use syntax_pos::Span;
use crate::hir;
use crate::hir::def_id::DefId;
+2 -2
View File
@@ -14,9 +14,9 @@
use crate::ty::{self, List, Ty, TyCtxt};
use rustc_data_structures::fx::FxHashMap;
use rustc_serialize::{opaque, Decodable, Decoder, Encodable, Encoder};
use rustc_span::Span;
use std::hash::Hash;
use std::intrinsics;
use syntax_pos::Span;
/// The shorthand encoding uses an enum's variant index `usize`
/// and is offset by this value so it never matches a real variant.
@@ -355,7 +355,7 @@ mod __ty_decoder_impl {
use $crate::ty::subst::SubstsRef;
use $crate::hir::def_id::{CrateNum};
use syntax_pos::Span;
use rustc_span::Span;
use super::$DecoderName;
+1 -1
View File
@@ -3,9 +3,9 @@
use crate::hir::map::blocks::FnLikeNode;
use crate::ty::query::Providers;
use crate::ty::TyCtxt;
use rustc_span::symbol::Symbol;
use rustc_target::spec::abi::Abi;
use syntax::attr;
use syntax_pos::symbol::Symbol;
impl<'tcx> TyCtxt<'tcx> {
/// Whether the `def_id` counts as const fn in your current crate, considering all active
+1 -1
View File
@@ -59,6 +59,7 @@
use rustc_data_structures::sync::{Lock, Lrc, WorkerLocal};
use rustc_index::vec::{Idx, IndexVec};
use rustc_macros::HashStable;
use rustc_span::Span;
use rustc_target::spec::abi;
use smallvec::SmallVec;
use std::any::Any;
@@ -76,7 +77,6 @@
use syntax::expand::allocator::AllocatorKind;
use syntax::source_map::MultiSpan;
use syntax::symbol::{kw, sym, Symbol};
use syntax_pos::Span;
pub struct AllArenas {
pub interner: SyncDroplessArena,
+1 -1
View File
@@ -3,10 +3,10 @@
use crate::ty::{self, BoundRegion, Region, Ty, TyCtxt};
use errors::{Applicability, DiagnosticBuilder};
use rustc_span::Span;
use rustc_target::spec::abi;
use syntax::ast;
use syntax::errors::pluralize;
use syntax_pos::Span;
use std::borrow::Cow;
use std::fmt;
+1 -1
View File
@@ -1,9 +1,9 @@
use crate::session::{self, DataTypeKind};
use crate::ty::{self, subst::SubstsRef, ReprOptions, Ty, TyCtxt, TypeFoldable};
use rustc_span::DUMMY_SP;
use syntax::ast::{self, Ident, IntTy, UintTy};
use syntax::attr;
use syntax_pos::DUMMY_SP;
use std::cmp;
use std::fmt;
+3 -3
View File
@@ -35,6 +35,9 @@
use rustc_data_structures::sync::{self, par_iter, Lrc, ParallelIterator};
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 std::cell::RefCell;
use std::cmp::{self, Ordering};
@@ -46,9 +49,6 @@
use std::{mem, ptr};
use syntax::ast::{self, Ident, Name, NodeId};
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::stable_hasher::{HashStable, StableHasher};
+7 -7
View File
@@ -4,7 +4,7 @@
use crate::ty::tls;
use rustc_data_structures::sync::Lrc;
use syntax_pos::Span;
use rustc_span::Span;
#[cfg(not(parallel_compiler))]
use std::ptr;
@@ -17,9 +17,9 @@
rustc_data_structures::sync::Lock,
rustc_data_structures::{jobserver, OnDrop},
rustc_rayon_core as rayon_core,
rustc_span::DUMMY_SP,
std::iter::FromIterator,
std::{mem, process, thread},
syntax_pos::DUMMY_SP,
};
/// 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 = &*gcx_ptr;
let syntax_pos_globals =
syntax_pos::GLOBALS.with(|syntax_pos_globals| syntax_pos_globals as *const _);
let syntax_pos_globals = &*syntax_pos_globals;
let rustc_span_globals =
rustc_span::GLOBALS.with(|rustc_span_globals| rustc_span_globals as *const _);
let rustc_span_globals = &*rustc_span_globals;
let syntax_globals = syntax::GLOBALS.with(|syntax_globals| syntax_globals as *const _);
let syntax_globals = &*syntax_globals;
thread::spawn(move || {
tls::GCX_PTR.set(gcx_ptr, || {
syntax::GLOBALS.set(syntax_globals, || {
syntax_pos::GLOBALS
.set(syntax_pos_globals, || tls::with_global(|tcx| deadlock(tcx, &registry)))
rustc_span::GLOBALS
.set(rustc_span_globals, || tls::with_global(|tcx| deadlock(tcx, &registry)))
});
})
});
+2 -2
View File
@@ -8,8 +8,8 @@
use crate::ty::subst::SubstsRef;
use crate::ty::{self, Ty, TyCtxt};
use syntax_pos::symbol::Symbol;
use syntax_pos::{Span, DUMMY_SP};
use rustc_span::symbol::Symbol;
use rustc_span::{Span, DUMMY_SP};
/// The `Key` trait controls what types can legally be used as the key
/// for a query.
+1 -1
View File
@@ -47,6 +47,7 @@
use rustc_index::vec::IndexVec;
use rustc_target::spec::PanicStrategy;
use rustc_span::{Span, DUMMY_SP};
use std::any::type_name;
use std::borrow::Cow;
use std::ops::Deref;
@@ -54,7 +55,6 @@
use syntax::ast;
use syntax::attr;
use syntax::symbol::Symbol;
use syntax_pos::{Span, DUMMY_SP};
#[macro_use]
mod plumbing;
+2 -2
View File
@@ -20,11 +20,11 @@
opaque, Decodable, Decoder, Encodable, Encoder, SpecializedDecoder, SpecializedEncoder,
UseSpecializedDecodable, UseSpecializedEncodable,
};
use rustc_span::hygiene::{ExpnId, SyntaxContext};
use rustc_span::{BytePos, SourceFile, Span, DUMMY_SP};
use std::mem;
use syntax::ast::{Ident, NodeId};
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;
+1 -1
View File
@@ -20,12 +20,12 @@
use rustc_data_structures::sharded::Sharded;
use rustc_data_structures::sync::{Lock, Lrc};
use rustc_data_structures::thin_vec::ThinVec;
use rustc_span::Span;
use std::collections::hash_map::Entry;
use std::hash::{Hash, Hasher};
use std::mem;
use std::ptr;
use syntax::source_map::DUMMY_SP;
use syntax_pos::Span;
use rustc_error_codes::*;
+2 -2
View File
@@ -274,7 +274,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
crate::middle::region::Scope,
::syntax::ast::FloatTy,
::syntax::ast::NodeId,
::syntax_pos::symbol::Symbol,
::rustc_span::symbol::Symbol,
crate::hir::def::Res,
crate::hir::def_id::DefId,
crate::hir::InlineAsmInner,
@@ -303,7 +303,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
crate::ty::RegionVid,
crate::ty::UniverseIndex,
crate::ty::Variance,
::syntax_pos::Span,
::rustc_span::Span,
}
///////////////////////////////////////////////////////////////////////////
+1 -1
View File
@@ -5,7 +5,7 @@
use rustc_data_structures::fx::FxHashSet;
use syntax_pos::Span;
use rustc_span::Span;
use crate::ty::fold::{TypeFoldable, TypeVisitor};
use crate::ty::{self, AdtDef, Ty, TyCtxt};
+1 -1
View File
@@ -8,8 +8,8 @@
use rustc_macros::HashStable;
use rustc_serialize::{self, Decodable, Decoder, Encodable, Encoder};
use rustc_span::{Span, DUMMY_SP};
use smallvec::SmallVec;
use syntax_pos::{Span, DUMMY_SP};
use core::intrinsics;
use std::cmp::Ordering;
+1 -1
View File
@@ -18,10 +18,10 @@
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_macros::HashStable;
use rustc_span::{Span, DUMMY_SP};
use std::{cmp, fmt};
use syntax::ast;
use syntax::attr::{self, SignedInt, UnsignedInt};
use syntax_pos::{Span, DUMMY_SP};
#[derive(Copy, Clone, Debug)]
pub struct Discr<'tcx> {
+1 -1
View File
@@ -5,9 +5,9 @@
use crate::traits::{self, AssocTypeBoundData};
use crate::ty::subst::SubstsRef;
use crate::ty::{self, ToPredicate, Ty, TyCtxt, TypeFoldable};
use rustc_span::Span;
use std::iter::once;
use syntax::symbol::{kw, Ident};
use syntax_pos::Span;
/// Returns the set of obligations needed to make `ty` well-formed.
/// If `ty` contains unresolved inference variables, this may include
+1 -1
View File
@@ -1,8 +1,8 @@
// These functions are used by macro expansion for bug! and span_bug!
use crate::ty::tls;
use rustc_span::{MultiSpan, Span};
use std::fmt;
use syntax_pos::{MultiSpan, Span};
#[cold]
#[inline(never)]
+1 -1
View File
@@ -20,5 +20,5 @@ rustc_target = { path = "../librustc_target" }
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
syntax = { path = "../libsyntax" }
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" }
+1 -1
View File
@@ -5,13 +5,13 @@
use errors::{DiagnosticBuilder, PResult};
use rustc_expand::base::*;
use rustc_parse::parser::Parser;
use rustc_span::Span;
use syntax::ast::{self, AsmDialect};
use syntax::ptr::P;
use syntax::symbol::{kw, sym, Symbol};
use syntax::token::{self, Token};
use syntax::tokenstream::{self, TokenStream};
use syntax::{span_err, struct_span_err};
use syntax_pos::Span;
use rustc_error_codes::*;
+1 -1
View File
@@ -2,13 +2,13 @@
use rustc_expand::base::*;
use rustc_parse::parser::Parser;
use rustc_span::{Span, DUMMY_SP};
use syntax::ast::{self, *};
use syntax::print::pprust;
use syntax::ptr::P;
use syntax::symbol::{sym, Symbol};
use syntax::token::{self, TokenKind};
use syntax::tokenstream::{DelimSpan, TokenStream, TokenTree};
use syntax_pos::{Span, DUMMY_SP};
pub fn expand_assert<'cx>(
cx: &'cx mut ExtCtxt<'_>,
+1 -1
View File
@@ -4,11 +4,11 @@
use errors::DiagnosticBuilder;
use rustc_expand::base::{self, *};
use rustc_span::Span;
use syntax::ast;
use syntax::attr;
use syntax::token;
use syntax::tokenstream::TokenStream;
use syntax_pos::Span;
pub fn expand_cfg(
cx: &mut ExtCtxt<'_>,
+1 -1
View File
@@ -1,11 +1,11 @@
//! Attributes injected into the crate root from command line using `-Z crate-attr`.
use rustc_expand::panictry;
use rustc_span::FileName;
use syntax::ast::{self, AttrItem, AttrStyle};
use syntax::attr::mk_attr;
use syntax::sess::ParseSess;
use syntax::token;
use syntax_pos::FileName;
pub fn inject(mut krate: ast::Crate, parse_sess: &ParseSess, attrs: &[String]) -> ast::Crate {
for raw_attr in attrs {
+1 -1
View File
@@ -1,8 +1,8 @@
// The compiler code necessary to support the compile_error! extension.
use rustc_expand::base::{self, *};
use rustc_span::Span;
use syntax::tokenstream::TokenStream;
use syntax_pos::Span;
pub fn expand_compile_error<'cx>(
cx: &'cx mut ExtCtxt<'_>,
+1 -1
View File
@@ -7,7 +7,7 @@
pub fn expand_concat(
cx: &mut base::ExtCtxt<'_>,
sp: syntax_pos::Span,
sp: rustc_span::Span,
tts: TokenStream,
) -> Box<dyn base::MacResult + 'static> {
let es = match base::get_exprs_from_tts(cx, sp, tts) {
+2 -2
View File
@@ -1,10 +1,10 @@
use rustc_expand::base::{self, *};
use rustc_span::symbol::Symbol;
use rustc_span::Span;
use syntax::ast;
use syntax::ptr::P;
use syntax::token::{self, Token};
use syntax::tokenstream::{TokenStream, TokenTree};
use syntax_pos::symbol::Symbol;
use syntax_pos::Span;
pub fn expand_concat_idents<'cx>(
cx: &'cx mut ExtCtxt<'_>,
@@ -3,8 +3,8 @@
use crate::deriving::path_std;
use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::Span;
use syntax::ast::MetaItem;
use syntax_pos::Span;
pub fn expand_deriving_copy(
cx: &mut ExtCtxt<'_>,
@@ -3,10 +3,10 @@
use crate::deriving::path_std;
use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::Span;
use syntax::ast::{self, Expr, GenericArg, Generics, ItemKind, MetaItem, VariantData};
use syntax::ptr::P;
use syntax::symbol::{kw, sym, Symbol};
use syntax_pos::Span;
pub fn expand_deriving_clone(
cx: &mut ExtCtxt<'_>,
@@ -3,10 +3,10 @@
use crate::deriving::path_std;
use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::Span;
use syntax::ast::{self, Expr, GenericArg, Ident, MetaItem};
use syntax::ptr::P;
use syntax::symbol::{sym, Symbol};
use syntax_pos::Span;
pub fn expand_deriving_eq(
cx: &mut ExtCtxt<'_>,
@@ -3,10 +3,10 @@
use crate::deriving::path_std;
use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::Span;
use syntax::ast::{self, Expr, MetaItem};
use syntax::ptr::P;
use syntax::symbol::sym;
use syntax_pos::Span;
pub fn expand_deriving_ord(
cx: &mut ExtCtxt<'_>,
@@ -3,10 +3,10 @@
use crate::deriving::{path_local, path_std};
use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::Span;
use syntax::ast::{BinOpKind, Expr, MetaItem};
use syntax::ptr::P;
use syntax::symbol::sym;
use syntax_pos::Span;
pub fn expand_deriving_partial_eq(
cx: &mut ExtCtxt<'_>,
@@ -5,10 +5,10 @@
use crate::deriving::{path_local, path_std, pathvec_std};
use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::Span;
use syntax::ast::{self, BinOpKind, Expr, MetaItem};
use syntax::ptr::P;
use syntax::symbol::{sym, Symbol};
use syntax_pos::Span;
pub fn expand_deriving_partial_ord(
cx: &mut ExtCtxt<'_>,
@@ -3,11 +3,11 @@
use crate::deriving::path_std;
use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::{Span, DUMMY_SP};
use syntax::ast::{self, Ident};
use syntax::ast::{Expr, MetaItem};
use syntax::ptr::P;
use syntax::symbol::sym;
use syntax_pos::{Span, DUMMY_SP};
pub fn expand_deriving_debug(
cx: &mut ExtCtxt<'_>,
@@ -5,11 +5,11 @@
use crate::deriving::pathvec_std;
use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::Span;
use syntax::ast;
use syntax::ast::{Expr, MetaItem, Mutability};
use syntax::ptr::P;
use syntax::symbol::Symbol;
use syntax_pos::Span;
pub fn expand_deriving_rustc_decodable(
cx: &mut ExtCtxt<'_>,
@@ -3,11 +3,11 @@
use crate::deriving::path_std;
use rustc_expand::base::{Annotatable, DummyResult, ExtCtxt};
use rustc_span::Span;
use syntax::ast::{Expr, MetaItem};
use syntax::ptr::P;
use syntax::span_err;
use syntax::symbol::{kw, sym};
use syntax_pos::Span;
use rustc_error_codes::*;
@@ -90,10 +90,10 @@
use crate::deriving::pathvec_std;
use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::Span;
use syntax::ast::{Expr, ExprKind, MetaItem, Mutability};
use syntax::ptr::P;
use syntax::symbol::Symbol;
use syntax_pos::Span;
pub fn expand_deriving_rustc_encodable(
cx: &mut ExtCtxt<'_>,
@@ -182,6 +182,7 @@
use std::vec;
use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::Span;
use syntax::ast::{self, BinOpKind, EnumDef, Expr, Generics, Ident, PatKind};
use syntax::ast::{GenericArg, GenericParamKind, VariantData};
use syntax::attr;
@@ -190,7 +191,6 @@
use syntax::source_map::respan;
use syntax::symbol::{kw, sym, Symbol};
use syntax::util::map_in_place::MapInPlace;
use syntax_pos::Span;
use ty::{LifetimeBounds, Path, Ptr, PtrTy, Self_, Ty};
@@ -5,11 +5,11 @@
pub use Ty::*;
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::ptr::P;
use syntax::source_map::{respan, DUMMY_SP};
use syntax_pos::symbol::kw;
use syntax_pos::Span;
/// The types of pointers
#[derive(Clone)]
+1 -1
View File
@@ -3,10 +3,10 @@
use crate::deriving::{self, path_std, pathvec_std};
use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::Span;
use syntax::ast::{Expr, MetaItem, Mutability};
use syntax::ptr::P;
use syntax::symbol::sym;
use syntax_pos::Span;
pub fn expand_deriving_hash(
cx: &mut ExtCtxt<'_>,
+1 -1
View File
@@ -1,10 +1,10 @@
//! The compiler code necessary to implement the `#[derive]` extensions.
use rustc_expand::base::{Annotatable, ExtCtxt, MultiItemModifier};
use rustc_span::Span;
use syntax::ast::{self, ItemKind, MetaItem};
use syntax::ptr::P;
use syntax::symbol::{sym, Symbol};
use syntax_pos::Span;
macro path_local($x:ident) {
generic::ty::Path::new_local(stringify!($x))
+1 -1
View File
@@ -4,10 +4,10 @@
//
use rustc_expand::base::{self, *};
use rustc_span::Span;
use syntax::ast::{self, GenericArg, Ident};
use syntax::symbol::{kw, sym, Symbol};
use syntax::tokenstream::TokenStream;
use syntax_pos::Span;
use std::env;
+1 -1
View File
@@ -8,12 +8,12 @@
use errors::DiagnosticBuilder;
use rustc_expand::base::{self, *};
use rustc_span::{MultiSpan, Span};
use syntax::ast;
use syntax::ptr::P;
use syntax::symbol::{sym, Symbol};
use syntax::token;
use syntax::tokenstream::TokenStream;
use syntax_pos::{MultiSpan, Span};
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use std::borrow::Cow;
@@ -1,6 +1,6 @@
pub mod printf {
use super::strcursor::StrCursor as Cur;
use syntax_pos::InnerSpan;
use rustc_span::InnerSpan;
/// Represents a single `printf`-style substitution.
#[derive(Clone, PartialEq, Debug)]
@@ -604,7 +604,7 @@ fn is_flag(c: char) -> bool {
pub mod shell {
use super::strcursor::StrCursor as Cur;
use syntax_pos::InnerSpan;
use rustc_span::InnerSpan;
#[derive(Clone, PartialEq, Debug)]
pub enum Substitution<'a> {
@@ -37,7 +37,7 @@ macro_rules! assert_pns_eq_sub {
precision: $prec,
length: $len,
type_: $type_,
position: syntax_pos::InnerSpan::new($pos.0, $pos.1),
position: rustc_span::InnerSpan::new($pos.0, $pos.1),
}),
"!"
))
@@ -1,12 +1,12 @@
use crate::util::check_builtin_macro_attribute;
use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::Span;
use syntax::ast::{self, Attribute, Expr, FnHeader, FnSig, Generics, Ident, Param};
use syntax::ast::{ItemKind, Mutability, Stmt, Ty, TyKind, Unsafety};
use syntax::expand::allocator::{AllocatorKind, AllocatorMethod, AllocatorTy, ALLOCATOR_METHODS};
use syntax::ptr::P;
use syntax::symbol::{kw, sym, Symbol};
use syntax_pos::Span;
pub fn expand(
ecx: &mut ExtCtxt<'_>,
+1 -1
View File
@@ -10,13 +10,13 @@
use errors::DiagnosticBuilder;
use rustc_expand::base::{self, *};
use rustc_span::Span;
use smallvec::smallvec;
use syntax::ast;
use syntax::ptr::P;
use syntax::source_map::respan;
use syntax::token;
use syntax::tokenstream::TokenStream;
use syntax_pos::Span;
pub fn expand_global_asm<'cx>(
cx: &'cx mut ExtCtxt<'_>,
+2 -2
View File
@@ -1,11 +1,11 @@
use rustc_expand::base;
use rustc_span;
use syntax::print;
use syntax::tokenstream::TokenStream;
use syntax_pos;
pub fn expand_log_syntax<'cx>(
_cx: &'cx mut base::ExtCtxt<'_>,
sp: syntax_pos::Span,
sp: rustc_span::Span,
tts: TokenStream,
) -> Box<dyn base::MacResult + 'cx> {
println!("{}", print::pprust::tts_to_string(tts));

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