about summary refs log tree commit diff
path: root/src/librustc
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2019-12-31 20:15:40 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2020-01-01 09:15:18 +0300
commit70f1d57048d2c73c8c018d0d65ceb0e2ca5d9dae (patch)
treeed077cbfc27cfa99565965681f03138285b1cb00 /src/librustc
parent38aa6bdfd705ea0604d7d5dd9fabc5e8f853a4fc (diff)
downloadrust-70f1d57048d2c73c8c018d0d65ceb0e2ca5d9dae.tar.gz
rust-70f1d57048d2c73c8c018d0d65ceb0e2ca5d9dae.zip
Rename `syntax_pos` to `rustc_span` in source code
Diffstat (limited to 'src/librustc')
-rw-r--r--src/librustc/Cargo.toml2
-rw-r--r--src/librustc/dep_graph/dep_node.rs2
-rw-r--r--src/librustc/hir/check_attr.rs2
-rw-r--r--src/librustc/hir/def.rs4
-rw-r--r--src/librustc/hir/intravisit.rs2
-rw-r--r--src/librustc/hir/map/blocks.rs2
-rw-r--r--src/librustc/hir/map/collector.rs2
-rw-r--r--src/librustc/hir/map/definitions.rs6
-rw-r--r--src/librustc/hir/map/mod.rs4
-rw-r--r--src/librustc/hir/mod.rs6
-rw-r--r--src/librustc/hir/pat_util.rs2
-rw-r--r--src/librustc/hir/print.rs28
-rw-r--r--src/librustc/hir/upvars.rs2
-rw-r--r--src/librustc/ich/hcx.rs4
-rw-r--r--src/librustc/ich/impls_syntax.rs20
-rw-r--r--src/librustc/ich/mod.rs2
-rw-r--r--src/librustc/infer/canonical/canonicalizer.rs2
-rw-r--r--src/librustc/infer/canonical/query_response.rs2
-rw-r--r--src/librustc/infer/combine.rs2
-rw-r--r--src/librustc/infer/error_reporting/mod.rs2
-rw-r--r--src/librustc/infer/error_reporting/need_type_info.rs2
-rw-r--r--src/librustc/infer/error_reporting/nice_region_error/trait_impl_difference.rs2
-rw-r--r--src/librustc/infer/error_reporting/nice_region_error/util.rs2
-rw-r--r--src/librustc/infer/lexical_region_resolve/mod.rs2
-rw-r--r--src/librustc/infer/mod.rs6
-rw-r--r--src/librustc/infer/nll_relate/mod.rs2
-rw-r--r--src/librustc/infer/opaque_types/mod.rs2
-rw-r--r--src/librustc/infer/outlives/env.rs2
-rw-r--r--src/librustc/infer/region_constraints/mod.rs2
-rw-r--r--src/librustc/infer/type_variable.rs2
-rw-r--r--src/librustc/infer/unify_key.rs2
-rw-r--r--src/librustc/lint/context.rs2
-rw-r--r--src/librustc/lint/mod.rs4
-rw-r--r--src/librustc/middle/cstore.rs2
-rw-r--r--src/librustc/middle/lang_items.rs2
-rw-r--r--src/librustc/middle/region.rs2
-rw-r--r--src/librustc/middle/stability.rs2
-rw-r--r--src/librustc/middle/weak_lang_items.rs2
-rw-r--r--src/librustc/mir/interpret/error.rs2
-rw-r--r--src/librustc/mir/interpret/queries.rs2
-rw-r--r--src/librustc/mir/mod.rs2
-rw-r--r--src/librustc/mir/visit.rs2
-rw-r--r--src/librustc/query/mod.rs4
-rw-r--r--src/librustc/traits/coherence.rs2
-rw-r--r--src/librustc/traits/error_reporting.rs4
-rw-r--r--src/librustc/traits/mod.rs2
-rw-r--r--src/librustc/traits/object_safety.rs2
-rw-r--r--src/librustc/traits/on_unimplemented.rs2
-rw-r--r--src/librustc/traits/project.rs2
-rw-r--r--src/librustc/traits/specialize/mod.rs2
-rw-r--r--src/librustc/traits/util.rs2
-rw-r--r--src/librustc/ty/codec.rs4
-rw-r--r--src/librustc/ty/constness.rs2
-rw-r--r--src/librustc/ty/context.rs2
-rw-r--r--src/librustc/ty/error.rs2
-rw-r--r--src/librustc/ty/layout.rs2
-rw-r--r--src/librustc/ty/mod.rs6
-rw-r--r--src/librustc/ty/query/job.rs14
-rw-r--r--src/librustc/ty/query/keys.rs4
-rw-r--r--src/librustc/ty/query/mod.rs2
-rw-r--r--src/librustc/ty/query/on_disk_cache.rs4
-rw-r--r--src/librustc/ty/query/plumbing.rs2
-rw-r--r--src/librustc/ty/structural_impls.rs4
-rw-r--r--src/librustc/ty/structural_match.rs2
-rw-r--r--src/librustc/ty/subst.rs2
-rw-r--r--src/librustc/ty/util.rs2
-rw-r--r--src/librustc/ty/wf.rs2
-rw-r--r--src/librustc/util/bug.rs2
68 files changed, 114 insertions, 114 deletions
diff --git a/src/librustc/Cargo.toml b/src/librustc/Cargo.toml
index 19122424d6d..973384bcf05 100644
--- a/src/librustc/Cargo.toml
+++ b/src/librustc/Cargo.toml
@@ -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" }
diff --git a/src/librustc/dep_graph/dep_node.rs b/src/librustc/dep_graph/dep_node.rs
index 57f72ba0507..8c68f7272c0 100644
--- a/src/librustc/dep_graph/dep_node.rs
+++ b/src/librustc/dep_graph/dep_node.rs
@@ -65,9 +65,9 @@ use crate::traits::query::{
 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
diff --git a/src/librustc/hir/check_attr.rs b/src/librustc/hir/check_attr.rs
index 511244ca516..2b201cfe0a9 100644
--- a/src/librustc/hir/check_attr.rs
+++ b/src/librustc/hir/check_attr.rs
@@ -12,9 +12,9 @@ use crate::lint::builtin::UNUSED_ATTRIBUTES;
 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::*;
 
diff --git a/src/librustc/hir/def.rs b/src/librustc/hir/def.rs
index 38223843e27..6ba9a53799b 100644
--- a/src/librustc/hir/def.rs
+++ b/src/librustc/hir/def.rs
@@ -6,10 +6,10 @@ use crate::ty;
 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;
 
diff --git a/src/librustc/hir/intravisit.rs b/src/librustc/hir/intravisit.rs
index 9ac63001bf3..241febe0cf6 100644
--- a/src/librustc/hir/intravisit.rs
+++ b/src/librustc/hir/intravisit.rs
@@ -36,8 +36,8 @@ use super::itemlikevisit::DeepVisitor;
 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> {
diff --git a/src/librustc/hir/map/blocks.rs b/src/librustc/hir/map/blocks.rs
index 1267de4d978..9546c101dc8 100644
--- a/src/librustc/hir/map/blocks.rs
+++ b/src/librustc/hir/map/blocks.rs
@@ -15,8 +15,8 @@ use crate::hir as ast;
 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).
diff --git a/src/librustc/hir/map/collector.rs b/src/librustc/hir/map/collector.rs
index 28eff07a494..c1fe1bec342 100644
--- a/src/librustc/hir/map/collector.rs
+++ b/src/librustc/hir/map/collector.rs
@@ -11,10 +11,10 @@ use crate::session::Session;
 use crate::util::nodemap::FxHashMap;
 use rustc_data_structures::svh::Svh;
 use rustc_index::vec::IndexVec;
+use rustc_span::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};
diff --git a/src/librustc/hir/map/definitions.rs b/src/librustc/hir/map/definitions.rs
index 15819f3b6e0..60bacfbe2df 100644
--- a/src/librustc/hir/map/definitions.rs
+++ b/src/librustc/hir/map/definitions.rs
@@ -13,13 +13,13 @@ use crate::util::nodemap::NodeMap;
 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`
diff --git a/src/librustc/hir/map/mod.rs b/src/librustc/hir/map/mod.rs
index 7f7af331b3c..7445f35dd21 100644
--- a/src/librustc/hir/map/mod.rs
+++ b/src/librustc/hir/map/mod.rs
@@ -16,11 +16,11 @@ use crate::util::nodemap::FxHashMap;
 
 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;
diff --git a/src/librustc/hir/mod.rs b/src/librustc/hir/mod.rs
index dfd06da969b..d0cc87f7506 100644
--- a/src/librustc/hir/mod.rs
+++ b/src/librustc/hir/mod.rs
@@ -19,6 +19,9 @@ use errors::FatalError;
 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 @@ pub use syntax::ast::{CaptureBy, Constness, Movability, Mutability, Unsafety};
 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;
diff --git a/src/librustc/hir/pat_util.rs b/src/librustc/hir/pat_util.rs
index 0831f5403db..56b557b409c 100644
--- a/src/librustc/hir/pat_util.rs
+++ b/src/librustc/hir/pat_util.rs
@@ -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};
 
diff --git a/src/librustc/hir/print.rs b/src/librustc/hir/print.rs
index ae760d22f75..7cc57ed7528 100644
--- a/src/librustc/hir/print.rs
+++ b/src/librustc/hir/print.rs
@@ -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::sess::ParseSess;
 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 @@ impl<'a> State<'a> {
         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 @@ 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)
     }
 
@@ -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)
     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 @@ impl<'a> State<'a> {
         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 @@ impl<'a> State<'a> {
         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 @@ impl<'a> State<'a> {
         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 @@ impl<'a> State<'a> {
         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 @@ impl<'a> State<'a> {
         }
         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 @@ impl<'a> State<'a> {
             },
             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 @@ impl<'a> State<'a> {
 
     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() {
diff --git a/src/librustc/hir/upvars.rs b/src/librustc/hir/upvars.rs
index 827cf751394..ff6b0541078 100644
--- a/src/librustc/hir/upvars.rs
+++ b/src/librustc/hir/upvars.rs
@@ -6,7 +6,7 @@ use crate::hir::{self, HirId};
 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| {
diff --git a/src/librustc/ich/hcx.rs b/src/librustc/ich/hcx.rs
index 9442392ea9e..305b6058d34 100644
--- a/src/librustc/ich/hcx.rs
+++ b/src/librustc/ich/hcx.rs
@@ -9,10 +9,10 @@ use crate::ty::{fast_reject, TyCtxt};
 
 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 @@ 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 {
         self.hash_spans
     }
diff --git a/src/librustc/ich/impls_syntax.rs b/src/librustc/ich/impls_syntax.rs
index e13822aed4d..90e1cac211a 100644
--- a/src/librustc/ich/impls_syntax.rs
+++ b/src/librustc/ich/impls_syntax.rs
@@ -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 @@ 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
 }
 
 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)
 }
diff --git a/src/librustc/ich/mod.rs b/src/librustc/ich/mod.rs
index 4ad3e9482de..f07e8f38734 100644
--- a/src/librustc/ich/mod.rs
+++ b/src/librustc/ich/mod.rs
@@ -4,8 +4,8 @@ pub use self::hcx::{
     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;
 
diff --git a/src/librustc/infer/canonical/canonicalizer.rs b/src/librustc/infer/canonical/canonicalizer.rs
index d5666f6975b..b720168f356 100644
--- a/src/librustc/infer/canonical/canonicalizer.rs
+++ b/src/librustc/infer/canonical/canonicalizer.rs
@@ -190,7 +190,7 @@ impl CanonicalizeRegionMode for CanonicalizeQueryResponse {
                 // `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),
                     );
                 });
diff --git a/src/librustc/infer/canonical/query_response.rs b/src/librustc/infer/canonical/query_response.rs
index f35bec0c81d..5e402dc79a1 100644
--- a/src/librustc/infer/canonical/query_response.rs
+++ b/src/librustc/infer/canonical/query_response.rs
@@ -25,8 +25,8 @@ use crate::ty::{self, BoundVar, Ty, TyCtxt};
 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
diff --git a/src/librustc/infer/combine.rs b/src/librustc/infer/combine.rs
index 9e47c178415..a9e56a9264c 100644
--- a/src/librustc/infer/combine.rs
+++ b/src/librustc/infer/combine.rs
@@ -40,8 +40,8 @@ use crate::ty::subst::SubstsRef;
 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> {
diff --git a/src/librustc/infer/error_reporting/mod.rs b/src/librustc/infer/error_reporting/mod.rs
index b3a79c08833..e2b70abe6f0 100644
--- a/src/librustc/infer/error_reporting/mod.rs
+++ b/src/librustc/infer/error_reporting/mod.rs
@@ -67,9 +67,9 @@ use crate::ty::{
 
 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;
 
diff --git a/src/librustc/infer/error_reporting/need_type_info.rs b/src/librustc/infer/error_reporting/need_type_info.rs
index 5a6d336ee1b..a94595b227b 100644
--- a/src/librustc/infer/error_reporting/need_type_info.rs
+++ b/src/librustc/infer/error_reporting/need_type_info.rs
@@ -6,10 +6,10 @@ use crate::infer::InferCtxt;
 use crate::ty::print::Print;
 use crate::ty::{self, DefIdTree, Infer, Ty, TyVar};
 use errors::{Applicability, DiagnosticBuilder};
+use rustc_span::Span;
 use std::borrow::Cow;
 use syntax::source_map::DesugaringKind;
 use syntax::symbol::kw;
-use syntax_pos::Span;
 
 use rustc_error_codes::*;
 
diff --git a/src/librustc/infer/error_reporting/nice_region_error/trait_impl_difference.rs b/src/librustc/infer/error_reporting/nice_region_error/trait_impl_difference.rs
index 6f9fe25b630..a33cb511133 100644
--- a/src/librustc/infer/error_reporting/nice_region_error/trait_impl_difference.rs
+++ b/src/librustc/infer/error_reporting/nice_region_error/trait_impl_difference.rs
@@ -6,7 +6,7 @@ use crate::infer::{Subtype, ValuePairs};
 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`.
diff --git a/src/librustc/infer/error_reporting/nice_region_error/util.rs b/src/librustc/infer/error_reporting/nice_region_error/util.rs
index 95feef313c0..ece55c4a822 100644
--- a/src/librustc/infer/error_reporting/nice_region_error/util.rs
+++ b/src/librustc/infer/error_reporting/nice_region_error/util.rs
@@ -5,7 +5,7 @@ use crate::hir;
 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.
diff --git a/src/librustc/infer/lexical_region_resolve/mod.rs b/src/librustc/infer/lexical_region_resolve/mod.rs
index 723169b9f5f..3fd5d3b5de4 100644
--- a/src/librustc/infer/lexical_region_resolve/mod.rs
+++ b/src/librustc/infer/lexical_region_resolve/mod.rs
@@ -21,8 +21,8 @@ use rustc_data_structures::graph::implementation::{
 };
 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;
 
diff --git a/src/librustc/infer/mod.rs b/src/librustc/infer/mod.rs
index e563f986f57..f9bc9020f16 100644
--- a/src/librustc/infer/mod.rs
+++ b/src/librustc/infer/mod.rs
@@ -27,12 +27,12 @@ use crate::util::nodemap::{FxHashMap, FxHashSet};
 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 @@ impl RegionVariableOrigin {
             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`"),
         }
diff --git a/src/librustc/infer/nll_relate/mod.rs b/src/librustc/infer/nll_relate/mod.rs
index 74f1c26b0f2..6b53871b9e2 100644
--- a/src/librustc/infer/nll_relate/mod.rs
+++ b/src/librustc/infer/nll_relate/mod.rs
@@ -266,7 +266,7 @@ where
     ) -> 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) => {
diff --git a/src/librustc/infer/opaque_types/mod.rs b/src/librustc/infer/opaque_types/mod.rs
index 3e9f68cebef..8399737b3e6 100644
--- a/src/librustc/infer/opaque_types/mod.rs
+++ b/src/librustc/infer/opaque_types/mod.rs
@@ -13,7 +13,7 @@ use errors::DiagnosticBuilder;
 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::*;
 
diff --git a/src/librustc/infer/outlives/env.rs b/src/librustc/infer/outlives/env.rs
index a49b770ceb8..e27f1a8b26d 100644
--- a/src/librustc/infer/outlives/env.rs
+++ b/src/librustc/infer/outlives/env.rs
@@ -4,7 +4,7 @@ use crate::infer::{GenericKind, InferCtxt};
 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
diff --git a/src/librustc/infer/region_constraints/mod.rs b/src/librustc/infer/region_constraints/mod.rs
index 19b3c30e537..323aa1f7f01 100644
--- a/src/librustc/infer/region_constraints/mod.rs
+++ b/src/librustc/infer/region_constraints/mod.rs
@@ -15,7 +15,7 @@ use rustc_data_structures::fx::{FxHashMap, FxHashSet};
 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;
diff --git a/src/librustc/infer/type_variable.rs b/src/librustc/infer/type_variable.rs
index fb301037fa5..43ded26b422 100644
--- a/src/librustc/infer/type_variable.rs
+++ b/src/librustc/infer/type_variable.rs
@@ -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;
diff --git a/src/librustc/infer/unify_key.rs b/src/librustc/infer/unify_key.rs
index 023b15f7943..cc05f4ee7a5 100644
--- a/src/librustc/infer/unify_key.rs
+++ b/src/librustc/infer/unify_key.rs
@@ -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;
diff --git a/src/librustc/lint/context.rs b/src/librustc/lint/context.rs
index 44258b62ca3..6e0bb3a2a2b 100644
--- a/src/librustc/lint/context.rs
+++ b/src/librustc/lint/context.rs
@@ -34,11 +34,11 @@ use crate::util::nodemap::FxHashMap;
 
 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::*;
 
diff --git a/src/librustc/lint/mod.rs b/src/librustc/lint/mod.rs
index f4684bd5222..7e433f50db2 100644
--- a/src/librustc/lint/mod.rs
+++ b/src/librustc/lint/mod.rs
@@ -32,11 +32,11 @@ use crate::ty::query::Providers;
 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,
diff --git a/src/librustc/middle/cstore.rs b/src/librustc/middle/cstore.rs
index 9dd913ab345..93c8ad77070 100644
--- a/src/librustc/middle/cstore.rs
+++ b/src/librustc/middle/cstore.rs
@@ -12,13 +12,13 @@ use rustc_data_structures::svh::Svh;
 
 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;
diff --git a/src/librustc/middle/lang_items.rs b/src/librustc/middle/lang_items.rs
index 5881b82f754..c07b65acff2 100644
--- a/src/librustc/middle/lang_items.rs
+++ b/src/librustc/middle/lang_items.rs
@@ -19,9 +19,9 @@ use crate::util::nodemap::FxHashMap;
 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::*;
 
diff --git a/src/librustc/middle/region.rs b/src/librustc/middle/region.rs
index a4c489735a9..dd03a703c89 100644
--- a/src/librustc/middle/region.rs
+++ b/src/librustc/middle/region.rs
@@ -16,7 +16,7 @@ use crate::util::nodemap::FxHashMap;
 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;
 
diff --git a/src/librustc/middle/stability.rs b/src/librustc/middle/stability.rs
index b692459eb51..7b186bc7a14 100644
--- a/src/librustc/middle/stability.rs
+++ b/src/librustc/middle/stability.rs
@@ -16,12 +16,12 @@ use crate::ty::{self, TyCtxt};
 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;
diff --git a/src/librustc/middle/weak_lang_items.rs b/src/librustc/middle/weak_lang_items.rs
index 600b05068cd..011c9fc27e0 100644
--- a/src/librustc/middle/weak_lang_items.rs
+++ b/src/librustc/middle/weak_lang_items.rs
@@ -9,10 +9,10 @@ use crate::hir::intravisit;
 use crate::hir::intravisit::{NestedVisitorMap, Visitor};
 use crate::ty::TyCtxt;
 use rustc_data_structures::fx::FxHashSet;
+use rustc_span::Span;
 use rustc_target::spec::PanicStrategy;
 use syntax::ast;
 use syntax::symbol::{sym, Symbol};
-use syntax_pos::Span;
 
 use rustc_error_codes::*;
 
diff --git a/src/librustc/mir/interpret/error.rs b/src/librustc/mir/interpret/error.rs
index 51f0818fe0b..2308da5d610 100644
--- a/src/librustc/mir/interpret/error.rs
+++ b/src/librustc/mir/interpret/error.rs
@@ -11,10 +11,10 @@ use backtrace::Backtrace;
 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::*;
 
diff --git a/src/librustc/mir/interpret/queries.rs b/src/librustc/mir/interpret/queries.rs
index c593a51e457..b560363c958 100644
--- a/src/librustc/mir/interpret/queries.rs
+++ b/src/librustc/mir/interpret/queries.rs
@@ -4,7 +4,7 @@ use crate::hir::def_id::DefId;
 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
diff --git a/src/librustc/mir/mod.rs b/src/librustc/mir/mod.rs
index dc74ff1e98d..bb1afdd877f 100644
--- a/src/librustc/mir/mod.rs
+++ b/src/librustc/mir/mod.rs
@@ -27,6 +27,7 @@ use rustc_index::bit_set::BitMatrix;
 use rustc_index::vec::{Idx, IndexVec};
 use rustc_macros::HashStable;
 use rustc_serialize::{Decodable, Encodable};
+use rustc_span::{Span, DUMMY_SP};
 use smallvec::SmallVec;
 use std::borrow::Cow;
 use std::fmt::{self, Debug, Display, Formatter, Write};
@@ -36,7 +37,6 @@ use std::{iter, mem, option, u32};
 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;
diff --git a/src/librustc/mir/visit.rs b/src/librustc/mir/visit.rs
index 50c5bd9299f..9173c328006 100644
--- a/src/librustc/mir/visit.rs
+++ b/src/librustc/mir/visit.rs
@@ -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
 //
diff --git a/src/librustc/query/mod.rs b/src/librustc/query/mod.rs
index 1cd0b67ef05..1534e922cdd 100644
--- a/src/librustc/query/mod.rs
+++ b/src/librustc/query/mod.rs
@@ -13,8 +13,8 @@ use crate::ty::query::QueryDescription;
 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 @@ rustc_queries! {
             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" }
         }
diff --git a/src/librustc/traits/coherence.rs b/src/librustc/traits/coherence.rs
index 3eaa9db0b15..9be18f45de6 100644
--- a/src/librustc/traits/coherence.rs
+++ b/src/librustc/traits/coherence.rs
@@ -12,8 +12,8 @@ use crate::traits::{self, Normalized, Obligation, ObligationCause, SelectionCont
 use crate::ty::fold::TypeFoldable;
 use crate::ty::subst::Subst;
 use crate::ty::{self, Ty, TyCtxt};
+use rustc_span::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.
diff --git a/src/librustc/traits/error_reporting.rs b/src/librustc/traits/error_reporting.rs
index 5819e7aa5c2..8a5a92fcfa6 100644
--- a/src/librustc/traits/error_reporting.rs
+++ b/src/librustc/traits/error_reporting.rs
@@ -25,11 +25,11 @@ use crate::util::nodemap::{FxHashMap, FxHashSet};
 
 use errors::{pluralize, Applicability, DiagnosticBuilder, Style};
 use rustc::hir::def_id::LOCAL_CRATE;
+use rustc_span::source_map::SourceMap;
+use rustc_span::{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::*;
 
diff --git a/src/librustc/traits/mod.rs b/src/librustc/traits/mod.rs
index fe373e02e10..5c44d5bda39 100644
--- a/src/librustc/traits/mod.rs
+++ b/src/librustc/traits/mod.rs
@@ -32,8 +32,8 @@ use crate::ty::{self, AdtKind, GenericParamDefKind, List, ToPredicate, Ty, TyCtx
 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;
diff --git a/src/librustc/traits/object_safety.rs b/src/librustc/traits/object_safety.rs
index ac49f522f43..97f75056f80 100644
--- a/src/librustc/traits/object_safety.rs
+++ b/src/librustc/traits/object_safety.rs
@@ -16,11 +16,11 @@ use crate::lint;
 use crate::traits::{self, Obligation, ObligationCause};
 use crate::ty::subst::{InternalSubsts, Subst};
 use crate::ty::{self, Predicate, ToPredicate, Ty, TyCtxt, TypeFoldable};
+use rustc_span::{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 {
diff --git a/src/librustc/traits/on_unimplemented.rs b/src/librustc/traits/on_unimplemented.rs
index ff4d8980054..5d90018e80a 100644
--- a/src/librustc/traits/on_unimplemented.rs
+++ b/src/librustc/traits/on_unimplemented.rs
@@ -5,10 +5,10 @@ use crate::ty::{self, GenericParamDefKind, TyCtxt};
 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::*;
 
diff --git a/src/librustc/traits/project.rs b/src/librustc/traits/project.rs
index bcb012ea514..c604bf59cbd 100644
--- a/src/librustc/traits/project.rs
+++ b/src/librustc/traits/project.rs
@@ -21,9 +21,9 @@ use crate::ty::{self, ToPolyTraitRef, ToPredicate, Ty, TyCtxt};
 use crate::util::common::FN_OUTPUT_NAME;
 use rustc_data_structures::snapshot_map::{Snapshot, SnapshotMap};
 use rustc_macros::HashStable;
+use rustc_span::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.
diff --git a/src/librustc/traits/specialize/mod.rs b/src/librustc/traits/specialize/mod.rs
index d527aa310ad..9d3e9e309c6 100644
--- a/src/librustc/traits/specialize/mod.rs
+++ b/src/librustc/traits/specialize/mod.rs
@@ -19,7 +19,7 @@ use crate::traits::{self, coherence, FutureCompatOverlapErrorKind, ObligationCau
 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};
diff --git a/src/librustc/traits/util.rs b/src/librustc/traits/util.rs
index d36ff8c236f..99f6e933fb4 100644
--- a/src/librustc/traits/util.rs
+++ b/src/librustc/traits/util.rs
@@ -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;
diff --git a/src/librustc/ty/codec.rs b/src/librustc/ty/codec.rs
index d55b756adf6..3ccbc096d02 100644
--- a/src/librustc/ty/codec.rs
+++ b/src/librustc/ty/codec.rs
@@ -14,9 +14,9 @@ use crate::ty::subst::SubstsRef;
 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 @@ macro_rules! implement_ty_decoder {
             use $crate::ty::subst::SubstsRef;
             use $crate::hir::def_id::{CrateNum};
 
-            use syntax_pos::Span;
+            use rustc_span::Span;
 
             use super::$DecoderName;
 
diff --git a/src/librustc/ty/constness.rs b/src/librustc/ty/constness.rs
index 35d5bdaf182..518ad63bdd0 100644
--- a/src/librustc/ty/constness.rs
+++ b/src/librustc/ty/constness.rs
@@ -3,9 +3,9 @@ use crate::hir::def_id::DefId;
 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
diff --git a/src/librustc/ty/context.rs b/src/librustc/ty/context.rs
index b84b0e4f45d..daa5ca37a98 100644
--- a/src/librustc/ty/context.rs
+++ b/src/librustc/ty/context.rs
@@ -59,6 +59,7 @@ use rustc_data_structures::stable_hasher::{
 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::attr;
 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,
diff --git a/src/librustc/ty/error.rs b/src/librustc/ty/error.rs
index c4a134926ae..e2ecfd13d2f 100644
--- a/src/librustc/ty/error.rs
+++ b/src/librustc/ty/error.rs
@@ -3,10 +3,10 @@ use crate::hir::def_id::DefId;
 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;
diff --git a/src/librustc/ty/layout.rs b/src/librustc/ty/layout.rs
index 98aa299a704..63345f828e0 100644
--- a/src/librustc/ty/layout.rs
+++ b/src/librustc/ty/layout.rs
@@ -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;
diff --git a/src/librustc/ty/mod.rs b/src/librustc/ty/mod.rs
index 2c40c9dc9ef..2707d07633b 100644
--- a/src/librustc/ty/mod.rs
+++ b/src/librustc/ty/mod.rs
@@ -35,6 +35,9 @@ use rustc_macros::HashStable;
 
 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::slice;
 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};
diff --git a/src/librustc/ty/query/job.rs b/src/librustc/ty/query/job.rs
index fbcbfae9f8f..dd8274dcf22 100644
--- a/src/librustc/ty/query/job.rs
+++ b/src/librustc/ty/query/job.rs
@@ -4,7 +4,7 @@ use crate::ty::query::Query;
 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 @@ use {
     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)))
             });
         })
     });
diff --git a/src/librustc/ty/query/keys.rs b/src/librustc/ty/query/keys.rs
index 78e97f701ea..3cf0a07b29d 100644
--- a/src/librustc/ty/query/keys.rs
+++ b/src/librustc/ty/query/keys.rs
@@ -8,8 +8,8 @@ use crate::ty::fast_reject::SimplifiedType;
 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.
diff --git a/src/librustc/ty/query/mod.rs b/src/librustc/ty/query/mod.rs
index f523cee49ec..9a555ecf091 100644
--- a/src/librustc/ty/query/mod.rs
+++ b/src/librustc/ty/query/mod.rs
@@ -47,6 +47,7 @@ use rustc_data_structures::sync::Lrc;
 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 std::sync::Arc;
 use syntax::ast;
 use syntax::attr;
 use syntax::symbol::Symbol;
-use syntax_pos::{Span, DUMMY_SP};
 
 #[macro_use]
 mod plumbing;
diff --git a/src/librustc/ty/query/on_disk_cache.rs b/src/librustc/ty/query/on_disk_cache.rs
index 2a03413ee60..a432f43d133 100644
--- a/src/librustc/ty/query/on_disk_cache.rs
+++ b/src/librustc/ty/query/on_disk_cache.rs
@@ -20,11 +20,11 @@ use rustc_serialize::{
     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;
 
diff --git a/src/librustc/ty/query/plumbing.rs b/src/librustc/ty/query/plumbing.rs
index 0114cd9076a..0642de8c744 100644
--- a/src/librustc/ty/query/plumbing.rs
+++ b/src/librustc/ty/query/plumbing.rs
@@ -20,12 +20,12 @@ use rustc_data_structures::fx::{FxHashMap, FxHasher};
 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::*;
 
diff --git a/src/librustc/ty/structural_impls.rs b/src/librustc/ty/structural_impls.rs
index 61ee7288a9b..c92128a1467 100644
--- a/src/librustc/ty/structural_impls.rs
+++ b/src/librustc/ty/structural_impls.rs
@@ -274,7 +274,7 @@ CloneTypeFoldableAndLiftImpls! {
     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 @@ CloneTypeFoldableAndLiftImpls! {
     crate::ty::RegionVid,
     crate::ty::UniverseIndex,
     crate::ty::Variance,
-    ::syntax_pos::Span,
+    ::rustc_span::Span,
 }
 
 ///////////////////////////////////////////////////////////////////////////
diff --git a/src/librustc/ty/structural_match.rs b/src/librustc/ty/structural_match.rs
index 426dd93c557..13cb5fd1f38 100644
--- a/src/librustc/ty/structural_match.rs
+++ b/src/librustc/ty/structural_match.rs
@@ -5,7 +5,7 @@ use rustc::traits::{self, ConstPatternStructural, TraitEngine};
 
 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};
diff --git a/src/librustc/ty/subst.rs b/src/librustc/ty/subst.rs
index 3804b5aed71..0167fae0ce1 100644
--- a/src/librustc/ty/subst.rs
+++ b/src/librustc/ty/subst.rs
@@ -8,8 +8,8 @@ use crate::ty::{self, Lift, List, ParamConst, Ty, TyCtxt};
 
 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;
diff --git a/src/librustc/ty/util.rs b/src/librustc/ty/util.rs
index 41b3d0f7391..15fae10236d 100644
--- a/src/librustc/ty/util.rs
+++ b/src/librustc/ty/util.rs
@@ -18,10 +18,10 @@ use crate::util::common::ErrorReported;
 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> {
diff --git a/src/librustc/ty/wf.rs b/src/librustc/ty/wf.rs
index afd1b690232..1440813f47a 100644
--- a/src/librustc/ty/wf.rs
+++ b/src/librustc/ty/wf.rs
@@ -5,9 +5,9 @@ use crate::middle::lang_items;
 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
diff --git a/src/librustc/util/bug.rs b/src/librustc/util/bug.rs
index 8c1f416235a..c12b2859f72 100644
--- a/src/librustc/util/bug.rs
+++ b/src/librustc/util/bug.rs
@@ -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)]