Skip to content

Commit 82607d2

Browse files
committed
mv (mod) codemap source_map
1 parent cbd0595 commit 82607d2

File tree

104 files changed

+157
-153
lines changed

Some content is hidden

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

104 files changed

+157
-153
lines changed

src/librustc/hir/lowering.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ use syntax::errors;
6868
use syntax::ext::hygiene::{Mark, SyntaxContext};
6969
use syntax::print::pprust;
7070
use syntax::ptr::P;
71-
use syntax::codemap::{self, respan, CompilerDesugaringKind, Spanned};
71+
use syntax::source_map::{self, respan, CompilerDesugaringKind, Spanned};
7272
use syntax::std_inject;
7373
use syntax::symbol::{keywords, Symbol};
7474
use syntax::tokenstream::{Delimited, TokenStream, TokenTree};
@@ -614,14 +614,14 @@ impl<'a> LoweringContext<'a> {
614614

615615
fn allow_internal_unstable(&self, reason: CompilerDesugaringKind, span: Span) -> Span {
616616
let mark = Mark::fresh(Mark::root());
617-
mark.set_expn_info(codemap::ExpnInfo {
617+
mark.set_expn_info(source_map::ExpnInfo {
618618
call_site: span,
619619
def_site: Some(span),
620-
format: codemap::CompilerDesugaring(reason),
620+
format: source_map::CompilerDesugaring(reason),
621621
allow_internal_unstable: true,
622622
allow_internal_unsafe: false,
623623
local_inner_macros: false,
624-
edition: codemap::hygiene::default_edition(),
624+
edition: source_map::hygiene::default_edition(),
625625
});
626626
span.with_ctxt(SyntaxContext::empty().apply_mark(mark))
627627
}

src/librustc/hir/map/collector.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use middle::cstore::CrateStore;
1818
use session::CrateDisambiguator;
1919
use std::iter::repeat;
2020
use syntax::ast::{NodeId, CRATE_NODE_ID};
21-
use syntax::codemap::SourceMap;
21+
use syntax::source_map::SourceMap;
2222
use syntax_pos::Span;
2323

2424
use ich::StableHashingContext;

src/librustc/hir/map/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use middle::cstore::CrateStore;
2424
use rustc_target::spec::abi::Abi;
2525
use rustc_data_structures::svh::Svh;
2626
use syntax::ast::{self, Name, NodeId, CRATE_NODE_ID};
27-
use syntax::codemap::Spanned;
27+
use syntax::source_map::Spanned;
2828
use syntax::ext::base::MacroKind;
2929
use syntax_pos::{Span, DUMMY_SP};
3030

src/librustc/hir/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use util::nodemap::{NodeMap, FxHashSet};
2424
use mir::mono::Linkage;
2525

2626
use syntax_pos::{Span, DUMMY_SP, symbol::InternedString};
27-
use syntax::codemap::{self, Spanned};
27+
use syntax::source_map::{self, Spanned};
2828
use rustc_target::spec::abi::Abi;
2929
use syntax::ast::{self, CrateSugar, Ident, Name, NodeId, DUMMY_NODE_ID, AsmDialect};
3030
use syntax::ast::{Attribute, Lit, StrStyle, FloatTy, IntTy, UintTy, MetaItem};
@@ -1100,7 +1100,7 @@ pub type Stmt = Spanned<StmtKind>;
11001100
impl fmt::Debug for StmtKind {
11011101
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
11021102
// Sadness.
1103-
let spanned = codemap::dummy_spanned(self.clone());
1103+
let spanned = source_map::dummy_spanned(self.clone());
11041104
write!(f,
11051105
"stmt({}: {})",
11061106
spanned.node.id(),

src/librustc/hir/print.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub use self::AnnNode::*;
1212

1313
use rustc_target::spec::abi::Abi;
1414
use syntax::ast;
15-
use syntax::codemap::{SourceMap, Spanned};
15+
use syntax::source_map::{SourceMap, Spanned};
1616
use syntax::parse::ParseSess;
1717
use syntax::parse::lexer::comments;
1818
use syntax::print::pp::{self, Breaks};

src/librustc/ich/caching_codemap_view.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
use rustc_data_structures::sync::Lrc;
12-
use syntax::codemap::SourceMap;
12+
use syntax::source_map::SourceMap;
1313
use syntax_pos::{BytePos, SourceFile};
1414

1515
#[derive(Clone)]

src/librustc/ich/hcx.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use std::cell::RefCell;
2525

2626
use syntax::ast;
2727

28-
use syntax::codemap::SourceMap;
28+
use syntax::source_map::SourceMap;
2929
use syntax::ext::hygiene::SyntaxContext;
3030
use syntax::symbol::Symbol;
3131
use syntax_pos::{Span, DUMMY_SP};

src/librustc/infer/canonical/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ use rustc_data_structures::small_vec::SmallVec;
3737
use rustc_data_structures::sync::Lrc;
3838
use serialize::UseSpecializedDecodable;
3939
use std::ops::Index;
40-
use syntax::codemap::Span;
40+
use syntax::source_map::Span;
4141
use ty::fold::TypeFoldable;
4242
use ty::subst::Kind;
4343
use ty::{self, CanonicalVar, Lift, Region, Slice, TyCtxt};

src/librustc/infer/error_reporting/need_type_info.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use hir::intravisit::{self, Visitor, NestedVisitorMap};
1313
use infer::InferCtxt;
1414
use infer::type_variable::TypeVariableOrigin;
1515
use ty::{self, Ty, TyInfer, TyVar};
16-
use syntax::codemap::CompilerDesugaringKind;
16+
use syntax::source_map::CompilerDesugaringKind;
1717
use syntax_pos::Span;
1818
use errors::DiagnosticBuilder;
1919

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use infer::InferCtxt;
1212
use infer::lexical_region_resolve::RegionResolutionError;
1313
use infer::lexical_region_resolve::RegionResolutionError::*;
14-
use syntax::codemap::Span;
14+
use syntax::source_map::Span;
1515
use ty::{self, TyCtxt};
1616
use util::common::ErrorReported;
1717

src/librustc/lint/builtin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use errors::{Applicability, DiagnosticBuilder};
1818
use lint::{LintPass, LateLintPass, LintArray};
1919
use session::Session;
2020
use syntax::ast;
21-
use syntax::codemap::Span;
21+
use syntax::source_map::Span;
2222

2323
declare_lint! {
2424
pub EXCEEDING_BITSHIFTS,

src/librustc/lint/levels.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use rustc_data_structures::stable_hasher::{HashStable, ToStableHashKey,
2121
use session::Session;
2222
use syntax::ast;
2323
use syntax::attr;
24-
use syntax::codemap::MultiSpan;
24+
use syntax::source_map::MultiSpan;
2525
use syntax::feature_gate;
2626
use syntax::symbol::Symbol;
2727
use util::nodemap::FxHashMap;

src/librustc/lint/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ use lint::builtin::parser::QUESTION_MARK_MACRO_SEP;
4242
use session::{Session, DiagnosticMessageId};
4343
use std::{hash, ptr};
4444
use syntax::ast;
45-
use syntax::codemap::{MultiSpan, ExpnFormat};
45+
use syntax::source_map::{MultiSpan, ExpnFormat};
4646
use syntax::early_buffered_lints::BufferedEarlyLintId;
4747
use syntax::edition::Edition;
4848
use syntax::symbol::Symbol;

src/librustc/macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ macro_rules! impl_stable_hash_for {
147147
macro_rules! impl_stable_hash_for_spanned {
148148
($T:path) => (
149149

150-
impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for ::syntax::codemap::Spanned<$T>
150+
impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for ::syntax::source_map::Spanned<$T>
151151
{
152152
#[inline]
153153
fn hash_stable<W: StableHasherResult>(&self,

src/librustc/middle/dead.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use middle::privacy;
2424
use ty::{self, TyCtxt};
2525
use util::nodemap::FxHashSet;
2626

27-
use syntax::{ast, codemap};
27+
use syntax::{ast, source_map};
2828
use syntax::attr;
2929
use syntax_pos;
3030

@@ -115,7 +115,7 @@ impl<'a, 'tcx> MarkSymbolVisitor<'a, 'tcx> {
115115
}
116116

117117
fn handle_field_pattern_match(&mut self, lhs: &hir::Pat, def: Def,
118-
pats: &[codemap::Spanned<hir::FieldPat>]) {
118+
pats: &[source_map::Spanned<hir::FieldPat>]) {
119119
let variant = match self.tables.node_id_to_type(lhs.hir_id).sty {
120120
ty::TyAdt(adt, _) => adt.variant_of_def(def),
121121
_ => span_bug!(lhs.span, "non-ADT in struct pattern")

src/librustc/middle/region.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use ty;
2323
use std::fmt;
2424
use std::mem;
2525
use rustc_data_structures::sync::Lrc;
26-
use syntax::codemap;
26+
use syntax::source_map;
2727
use syntax::ast;
2828
use syntax_pos::{Span, DUMMY_SP};
2929
use ty::TyCtxt;
@@ -943,11 +943,15 @@ fn resolve_expr<'a, 'tcx>(visitor: &mut RegionResolutionVisitor<'a, 'tcx>, expr:
943943
// scopes, meaning that temporaries cannot outlive them.
944944
// This ensures fixed size stacks.
945945

946-
hir::ExprKind::Binary(codemap::Spanned { node: hir::BinOpKind::And, .. }, _, ref r) |
947-
hir::ExprKind::Binary(codemap::Spanned { node: hir::BinOpKind::Or, .. }, _, ref r) => {
948-
// For shortcircuiting operators, mark the RHS as a terminating
949-
// scope since it only executes conditionally.
950-
terminating(r.hir_id.local_id);
946+
hir::ExprKind::Binary(
947+
source_map::Spanned { node: hir::BinOpKind::And, .. },
948+
_, ref r) |
949+
hir::ExprKind::Binary(
950+
source_map::Spanned { node: hir::BinOpKind::Or, .. },
951+
_, ref r) => {
952+
// For shortcircuiting operators, mark the RHS as a terminating
953+
// scope since it only executes conditionally.
954+
terminating(r.hir_id.local_id);
951955
}
952956

953957
hir::ExprKind::If(ref expr, ref then, Some(ref otherwise)) => {

src/librustc/session/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use lint;
2222
use middle::cstore;
2323

2424
use syntax::ast::{self, IntTy, UintTy};
25-
use syntax::codemap::{FileName, FilePathMapping};
25+
use syntax::source_map::{FileName, FilePathMapping};
2626
use syntax::edition::{Edition, EDITION_NAME_LIST, DEFAULT_EDITION};
2727
use syntax::parse::token;
2828
use syntax::parse;

src/librustc/session/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ use syntax::json::JsonEmitter;
3535
use syntax::feature_gate;
3636
use syntax::parse;
3737
use syntax::parse::ParseSess;
38-
use syntax::{ast, codemap};
38+
use syntax::{ast, source_map};
3939
use syntax::feature_gate::AttributeType;
4040
use syntax_pos::{MultiSpan, Span};
4141
use util::profiling::SelfProfiler;
@@ -484,7 +484,7 @@ impl Session {
484484
);
485485
}
486486

487-
pub fn codemap<'a>(&'a self) -> &'a codemap::SourceMap {
487+
pub fn codemap<'a>(&'a self) -> &'a source_map::SourceMap {
488488
self.parse_sess.codemap()
489489
}
490490
pub fn verbose(&self) -> bool {
@@ -984,7 +984,7 @@ pub fn build_session(
984984
sopts,
985985
local_crate_source_file,
986986
registry,
987-
Lrc::new(codemap::SourceMap::new(file_path_mapping)),
987+
Lrc::new(source_map::SourceMap::new(file_path_mapping)),
988988
None,
989989
)
990990
}
@@ -993,7 +993,7 @@ pub fn build_session_with_codemap(
993993
sopts: config::Options,
994994
local_crate_source_file: Option<PathBuf>,
995995
registry: errors::registry::Registry,
996-
codemap: Lrc<codemap::SourceMap>,
996+
codemap: Lrc<source_map::SourceMap>,
997997
emitter_dest: Option<Box<dyn Write + Send>>,
998998
) -> Session {
999999
// FIXME: This is not general enough to make the warning lint completely override
@@ -1070,7 +1070,7 @@ pub fn build_session_(
10701070
sopts: config::Options,
10711071
local_crate_source_file: Option<PathBuf>,
10721072
span_diagnostic: errors::Handler,
1073-
codemap: Lrc<codemap::SourceMap>,
1073+
codemap: Lrc<source_map::SourceMap>,
10741074
) -> Session {
10751075
let host_triple = TargetTriple::from_triple(config::host_triple());
10761076
let host = match Target::search(&host_triple) {

src/librustc/traits/query/dropck_outlives.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use infer::at::At;
1212
use infer::InferOk;
1313
use rustc_data_structures::small_vec::SmallVec;
1414
use std::iter::FromIterator;
15-
use syntax::codemap::Span;
15+
use syntax::source_map::Span;
1616
use ty::subst::Kind;
1717
use ty::{self, Ty, TyCtxt};
1818

src/librustc/traits/query/outlives_bounds.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
use infer::InferCtxt;
1212
use syntax::ast;
13-
use syntax::codemap::Span;
13+
use syntax::source_map::Span;
1414
use rustc_data_structures::small_vec::SmallVec;
1515
use traits::{FulfillmentContext, ObligationCause, TraitEngine, TraitEngineExt};
1616
use traits::query::NoSolution;

src/librustc/traits/query/type_op/custom.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use traits::query::Fallible;
1515
use infer::canonical::query_result;
1616
use infer::canonical::QueryRegionConstraint;
1717
use std::rc::Rc;
18-
use syntax::codemap::DUMMY_SP;
18+
use syntax::source_map::DUMMY_SP;
1919
use traits::{ObligationCause, TraitEngine, TraitEngineExt};
2020

2121
pub struct CustomTypeOp<F, G> {

src/librustc/ty/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ use std::sync::Arc;
7373
use rustc_target::spec::abi;
7474
use syntax::ast::{self, NodeId};
7575
use syntax::attr;
76-
use syntax::codemap::MultiSpan;
76+
use syntax::source_map::MultiSpan;
7777
use syntax::edition::Edition;
7878
use syntax::feature_gate;
7979
use syntax::symbol::{Symbol, keywords, InternedString};

src/librustc/ty/query/on_disk_cache.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use rustc_serialize::{Decodable, Decoder, Encodable, Encoder, opaque,
2626
use session::{CrateDisambiguator, Session};
2727
use std::mem;
2828
use syntax::ast::NodeId;
29-
use syntax::codemap::{SourceMap, StableFilemapId};
29+
use syntax::source_map::{SourceMap, StableFilemapId};
3030
use syntax_pos::{BytePos, Span, DUMMY_SP, SourceFile};
3131
use syntax_pos::hygiene::{Mark, SyntaxContext, ExpnInfo};
3232
use ty;

src/librustc/ty/query/plumbing.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ use std::mem;
3232
use std::ptr;
3333
use std::collections::hash_map::Entry;
3434
use syntax_pos::Span;
35-
use syntax::codemap::DUMMY_SP;
35+
use syntax::source_map::DUMMY_SP;
3636

3737
pub struct QueryCache<'tcx, D: QueryConfig<'tcx> + ?Sized> {
3838
pub(super) results: FxHashMap<D::Key, QueryValue<D::Value>>,

src/librustc_allocator/expand.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use syntax::{
1717
Mac, Mod, Mutability, Ty, TyKind, Unsafety, VisibilityKind,
1818
},
1919
attr,
20-
codemap::{
20+
source_map::{
2121
respan, ExpnInfo, MacroAttribute,
2222
},
2323
ext::{

src/librustc_codegen_llvm/mir/constant.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use consts;
2525
use type_of::LayoutLlvmExt;
2626
use type_::Type;
2727
use syntax::ast::Mutability;
28-
use syntax::codemap::Span;
28+
use syntax::source_map::Span;
2929
use value::Value;
3030

3131
use super::super::callee;

src/librustc_driver/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ use std::sync::{Once, ONCE_INIT};
107107
use std::thread;
108108

109109
use syntax::ast;
110-
use syntax::codemap::{SourceMap, FileLoader, RealFileLoader};
110+
use syntax::source_map::{SourceMap, FileLoader, RealFileLoader};
111111
use syntax::feature_gate::{GatedCfg, UnstableFeatures};
112112
use syntax::parse::{self, PResult};
113113
use syntax_pos::{DUMMY_SP, MultiSpan, FileName};

src/librustc_driver/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ use rustc_data_structures::sync::{self, Lrc};
3232
use syntax;
3333
use syntax::ast;
3434
use rustc_target::spec::abi::Abi;
35-
use syntax::codemap::{SourceMap, FilePathMapping, FileName};
35+
use syntax::source_map::{SourceMap, FilePathMapping, FileName};
3636
use errors;
3737
use errors::emitter::Emitter;
3838
use errors::{Level, DiagnosticBuilder};

src/librustc_lint/builtin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ use rustc::util::nodemap::FxHashSet;
4545
use syntax::tokenstream::{TokenTree, TokenStream};
4646
use syntax::ast;
4747
use syntax::attr;
48-
use syntax::codemap::Spanned;
48+
use syntax::source_map::Spanned;
4949
use syntax::edition::Edition;
5050
use syntax::feature_gate::{AttributeGate, AttributeType, Stability, deprecated_attributes};
5151
use syntax_pos::{BytePos, Span, SyntaxContext};

src/librustc_lint/types.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use syntax::{ast, attr};
2525
use syntax::errors::Applicability;
2626
use rustc_target::spec::abi::Abi;
2727
use syntax_pos::Span;
28-
use syntax::codemap;
28+
use syntax::source_map;
2929

3030
use rustc::hir;
3131

@@ -208,7 +208,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for TypeLimits {
208208
}
209209

210210
fn rev_binop(binop: hir::BinOp) -> hir::BinOp {
211-
codemap::respan(binop.span,
211+
source_map::respan(binop.span,
212212
match binop.node {
213213
hir::BinOpKind::Lt => hir::BinOpKind::Gt,
214214
hir::BinOpKind::Le => hir::BinOpKind::Ge,

src/librustc_metadata/cstore_impl.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ use std::sync::Arc;
3838

3939
use syntax::ast;
4040
use syntax::attr;
41-
use syntax::codemap;
41+
use syntax::source_map;
4242
use syntax::edition::Edition;
4343
use syntax::parse::source_file_to_stream;
4444
use syntax::symbol::Symbol;
@@ -487,7 +487,7 @@ impl cstore::CStore {
487487
tokens: body.into(),
488488
legacy: def.legacy,
489489
}),
490-
vis: codemap::respan(local_span.shrink_to_lo(), ast::VisibilityKind::Inherited),
490+
vis: source_map::respan(local_span.shrink_to_lo(), ast::VisibilityKind::Inherited),
491491
tokens: None,
492492
})
493493
}

0 commit comments

Comments
 (0)