1
Fork 0

Move errors from libsyntax to its own crate

This commit is contained in:
Jonathan Turner 2016-06-21 18:08:13 -04:00
parent 3908913db5
commit 6ae3502134
266 changed files with 1389 additions and 1176 deletions

View file

@ -57,10 +57,10 @@ TARGET_CRATES := libc std term \
panic_abort panic_unwind unwind panic_abort panic_unwind unwind
RUSTC_CRATES := rustc rustc_typeck rustc_mir rustc_borrowck rustc_resolve rustc_driver \ RUSTC_CRATES := rustc rustc_typeck rustc_mir rustc_borrowck rustc_resolve rustc_driver \
rustc_trans rustc_back rustc_llvm rustc_privacy rustc_lint \ rustc_trans rustc_back rustc_llvm rustc_privacy rustc_lint \
rustc_data_structures rustc_platform_intrinsics \ rustc_data_structures rustc_platform_intrinsics rustc_errors \
rustc_plugin rustc_metadata rustc_passes rustc_save_analysis \ rustc_plugin rustc_metadata rustc_passes rustc_save_analysis \
rustc_const_eval rustc_const_math rustc_incremental rustc_const_eval rustc_const_math rustc_incremental
HOST_CRATES := syntax syntax_ext $(RUSTC_CRATES) rustdoc fmt_macros \ HOST_CRATES := syntax syntax_ext syntax_pos $(RUSTC_CRATES) rustdoc fmt_macros \
flate arena graphviz rbml log serialize flate arena graphviz rbml log serialize
TOOLS := compiletest rustdoc rustc rustbook error_index_generator TOOLS := compiletest rustdoc rustc rustbook error_index_generator
@ -98,43 +98,45 @@ DEPS_serialize := std log
DEPS_term := std DEPS_term := std
DEPS_test := std getopts term native:rust_test_helpers DEPS_test := std getopts term native:rust_test_helpers
DEPS_syntax := std term serialize log arena libc rustc_bitflags rustc_unicode DEPS_syntax := std term serialize log arena libc rustc_bitflags rustc_unicode rustc_errors syntax_pos
DEPS_syntax_ext := syntax fmt_macros DEPS_syntax_ext := syntax syntax_pos rustc_errors fmt_macros
DEPS_syntax_pos := serialize
DEPS_rustc_const_math := std syntax log serialize DEPS_rustc_const_math := std syntax log serialize
DEPS_rustc_const_eval := rustc_const_math rustc syntax log serialize \ DEPS_rustc_const_eval := rustc_const_math rustc syntax log serialize \
rustc_back graphviz rustc_back graphviz syntax_pos
DEPS_rustc := syntax fmt_macros flate arena serialize getopts rbml \ DEPS_rustc := syntax fmt_macros flate arena serialize getopts rbml \
log graphviz rustc_llvm rustc_back rustc_data_structures\ log graphviz rustc_llvm rustc_back rustc_data_structures\
rustc_const_math rustc_const_math syntax_pos rustc_errors
DEPS_rustc_back := std syntax flate log libc DEPS_rustc_back := std syntax flate log libc
DEPS_rustc_borrowck := rustc log graphviz syntax rustc_mir DEPS_rustc_borrowck := rustc log graphviz syntax syntax_pos rustc_errors rustc_mir
DEPS_rustc_data_structures := std log serialize DEPS_rustc_data_structures := std log serialize
DEPS_rustc_driver := arena flate getopts graphviz libc rustc rustc_back rustc_borrowck \ DEPS_rustc_driver := arena flate getopts graphviz libc rustc rustc_back rustc_borrowck \
rustc_typeck rustc_mir rustc_resolve log syntax serialize rustc_llvm \ rustc_typeck rustc_mir rustc_resolve log syntax serialize rustc_llvm \
rustc_trans rustc_privacy rustc_lint rustc_plugin \ rustc_trans rustc_privacy rustc_lint rustc_plugin \
rustc_metadata syntax_ext rustc_passes rustc_save_analysis rustc_const_eval \ rustc_metadata syntax_ext rustc_passes rustc_save_analysis rustc_const_eval \
rustc_incremental rustc_incremental syntax_pos rustc_errors
DEPS_rustc_lint := rustc log syntax rustc_const_eval DEPS_rustc_errors := log libc serialize syntax_pos
DEPS_rustc_lint := rustc log syntax syntax_pos rustc_const_eval
DEPS_rustc_llvm := native:rustllvm libc std rustc_bitflags DEPS_rustc_llvm := native:rustllvm libc std rustc_bitflags
DEPS_rustc_metadata := rustc syntax rbml rustc_const_math DEPS_rustc_metadata := rustc syntax syntax_pos rustc_errors rbml rustc_const_math
DEPS_rustc_passes := syntax rustc core rustc_const_eval DEPS_rustc_passes := syntax syntax_pos rustc core rustc_const_eval rustc_errors
DEPS_rustc_mir := rustc syntax rustc_const_math rustc_const_eval rustc_bitflags DEPS_rustc_mir := rustc syntax syntax_pos rustc_const_math rustc_const_eval rustc_bitflags
DEPS_rustc_resolve := arena rustc log syntax DEPS_rustc_resolve := arena rustc log syntax syntax_pos rustc_errors
DEPS_rustc_platform_intrinsics := std DEPS_rustc_platform_intrinsics := std
DEPS_rustc_plugin := rustc rustc_metadata syntax DEPS_rustc_plugin := rustc rustc_metadata syntax syntax_pos rustc_errors
DEPS_rustc_privacy := rustc log syntax DEPS_rustc_privacy := rustc log syntax syntax_pos
DEPS_rustc_trans := arena flate getopts graphviz libc rustc rustc_back \ DEPS_rustc_trans := arena flate getopts graphviz libc rustc rustc_back \
log syntax serialize rustc_llvm rustc_platform_intrinsics \ log syntax serialize rustc_llvm rustc_platform_intrinsics \
rustc_const_math rustc_const_eval rustc_incremental rustc_const_math rustc_const_eval rustc_incremental rustc_errors syntax_pos
DEPS_rustc_incremental := rbml rustc serialize rustc_data_structures DEPS_rustc_incremental := rbml rustc syntax_pos serialize rustc_data_structures
DEPS_rustc_save_analysis := rustc log syntax serialize DEPS_rustc_save_analysis := rustc log syntax syntax_pos serialize
DEPS_rustc_typeck := rustc syntax rustc_platform_intrinsics rustc_const_math \ DEPS_rustc_typeck := rustc syntax syntax_pos rustc_platform_intrinsics rustc_const_math \
rustc_const_eval rustc_const_eval rustc_errors
DEPS_rustdoc := rustc rustc_driver native:hoedown serialize getopts \ DEPS_rustdoc := rustc rustc_driver native:hoedown serialize getopts \
test rustc_lint rustc_const_eval test rustc_lint rustc_const_eval syntax_pos
TOOL_DEPS_compiletest := test getopts log serialize TOOL_DEPS_compiletest := test getopts log serialize

View file

@ -45,11 +45,11 @@ extern crate syntax;
extern crate rustc; extern crate rustc;
extern crate rustc_plugin; extern crate rustc_plugin;
use syntax::codemap::Span;
use syntax::parse::token; use syntax::parse::token;
use syntax::ast::TokenTree; use syntax::ast::TokenTree;
use syntax::ext::base::{ExtCtxt, MacResult, DummyResult, MacEager}; use syntax::ext::base::{ExtCtxt, MacResult, DummyResult, MacEager};
use syntax::ext::build::AstBuilder; // trait for expr_usize use syntax::ext::build::AstBuilder; // trait for expr_usize
use syntax_pos::Span;
use rustc_plugin::Registry; use rustc_plugin::Registry;
fn expand_rn(cx: &mut ExtCtxt, sp: Span, args: &[TokenTree]) fn expand_rn(cx: &mut ExtCtxt, sp: Span, args: &[TokenTree])

View file

@ -32,9 +32,9 @@ use std::rc::Rc;
use syntax::ast; use syntax::ast;
use syntax::ast::Name; use syntax::ast::Name;
use syntax::codemap; use syntax::codemap;
use syntax::codemap::Pos;
use syntax::parse::token::{self, BinOpToken, DelimToken, Lit, Token}; use syntax::parse::token::{self, BinOpToken, DelimToken, Lit, Token};
use syntax::parse::lexer::TokenAndSpan; use syntax::parse::lexer::TokenAndSpan;
use syntax_pos::Pos;
fn parse_token_list(file: &str) -> HashMap<String, token::Token> { fn parse_token_list(file: &str) -> HashMap<String, token::Token> {
fn id() -> token::Token { fn id() -> token::Token {
@ -233,10 +233,10 @@ fn parse_antlr_token(s: &str, tokens: &HashMap<String, token::Token>, surrogate_
lo -= surrogate_pairs_pos.binary_search(&(lo as usize)).unwrap_or_else(|x| x) as u32; lo -= surrogate_pairs_pos.binary_search(&(lo as usize)).unwrap_or_else(|x| x) as u32;
hi -= surrogate_pairs_pos.binary_search(&(hi as usize)).unwrap_or_else(|x| x) as u32; hi -= surrogate_pairs_pos.binary_search(&(hi as usize)).unwrap_or_else(|x| x) as u32;
let sp = codemap::Span { let sp = syntax_pos::Span {
lo: codemap::BytePos(lo), lo: syntax_pos::BytePos(lo),
hi: codemap::BytePos(hi), hi: syntax_pos::BytePos(hi),
expn_id: codemap::NO_EXPANSION expn_id: syntax_pos::NO_EXPANSION
}; };
TokenAndSpan { TokenAndSpan {

View file

@ -19,6 +19,8 @@ rustc_back = { path = "../librustc_back" }
rustc_bitflags = { path = "../librustc_bitflags" } rustc_bitflags = { path = "../librustc_bitflags" }
rustc_const_math = { path = "../librustc_const_math" } rustc_const_math = { path = "../librustc_const_math" }
rustc_data_structures = { path = "../librustc_data_structures" } rustc_data_structures = { path = "../librustc_data_structures" }
rustc_errors = { path = "../librustc_errors" }
rustc_llvm = { path = "../librustc_llvm" } rustc_llvm = { path = "../librustc_llvm" }
serialize = { path = "../libserialize" } serialize = { path = "../libserialize" }
syntax = { path = "../libsyntax" } syntax = { path = "../libsyntax" }
syntax_pos = { path "../libsyntax_pos" }

View file

@ -16,7 +16,8 @@ use syntax::ast::{Name, NodeId, DUMMY_NODE_ID, Attribute, Attribute_, MetaItem};
use syntax::ast::MetaItemKind; use syntax::ast::MetaItemKind;
use syntax::attr::ThinAttributesExt; use syntax::attr::ThinAttributesExt;
use hir; use hir;
use syntax::codemap::{respan, Span, Spanned}; use syntax_pos::Span;
use syntax::codemap::{respan, Spanned};
use syntax::ptr::P; use syntax::ptr::P;
use syntax::parse::token::keywords; use syntax::parse::token::keywords;
use syntax::util::move_map::MoveMap; use syntax::util::move_map::MoveMap;

View file

@ -28,7 +28,8 @@
use syntax::abi::Abi; use syntax::abi::Abi;
use syntax::ast::{NodeId, CRATE_NODE_ID, Name, Attribute}; use syntax::ast::{NodeId, CRATE_NODE_ID, Name, Attribute};
use syntax::attr::ThinAttributesExt; use syntax::attr::ThinAttributesExt;
use syntax::codemap::{Span, Spanned}; use syntax::codemap::Spanned;
use syntax_pos::Span;
use hir::*; use hir::*;
use std::cmp; use std::cmp;

View file

@ -52,10 +52,11 @@ use std::iter;
use syntax::ast::*; use syntax::ast::*;
use syntax::attr::{ThinAttributes, ThinAttributesExt}; use syntax::attr::{ThinAttributes, ThinAttributesExt};
use syntax::ptr::P; use syntax::ptr::P;
use syntax::codemap::{respan, Spanned, Span}; use syntax::codemap::{respan, Spanned};
use syntax::parse::token; use syntax::parse::token;
use syntax::std_inject; use syntax::std_inject;
use syntax::visit::{self, Visitor}; use syntax::visit::{self, Visitor};
use syntax_pos::Span;
pub struct LoweringContext<'a> { pub struct LoweringContext<'a> {
crate_root: Option<&'static str>, crate_root: Option<&'static str>,

View file

@ -29,7 +29,7 @@ use hir::{Block, FnDecl};
use syntax::ast::{Attribute, Name, NodeId}; use syntax::ast::{Attribute, Name, NodeId};
use syntax::attr::ThinAttributesExt; use syntax::attr::ThinAttributesExt;
use hir as ast; use hir as ast;
use syntax::codemap::Span; use syntax_pos::Span;
use hir::intravisit::FnKind; use hir::intravisit::FnKind;
/// An FnLikeNode is a Node that is like a fn, in that it has a decl /// An FnLikeNode is a Node that is like a fn, in that it has a decl

View file

@ -17,7 +17,7 @@ use hir::def_id::DefId;
use middle::cstore::InlinedItem; use middle::cstore::InlinedItem;
use std::iter::repeat; use std::iter::repeat;
use syntax::ast::{NodeId, CRATE_NODE_ID}; use syntax::ast::{NodeId, CRATE_NODE_ID};
use syntax::codemap::Span; use syntax_pos::Span;
/// A Visitor that walks over the HIR and collects Nodes into a HIR map /// A Visitor that walks over the HIR and collects Nodes into a HIR map
pub struct NodeCollector<'ast> { pub struct NodeCollector<'ast> {

View file

@ -24,8 +24,9 @@ use hir::def_id::{CRATE_DEF_INDEX, DefId, DefIndex};
use syntax::abi::Abi; use syntax::abi::Abi;
use syntax::ast::{self, Name, NodeId, DUMMY_NODE_ID, }; use syntax::ast::{self, Name, NodeId, DUMMY_NODE_ID, };
use syntax::attr::ThinAttributesExt; use syntax::attr::ThinAttributesExt;
use syntax::codemap::{Span, Spanned}; use syntax::codemap::Spanned;
use syntax::visit; use syntax::visit;
use syntax_pos::Span;
use hir::*; use hir::*;
use hir::fold::Folder; use hir::fold::Folder;

View file

@ -36,7 +36,8 @@ use hir::def::Def;
use hir::def_id::DefId; use hir::def_id::DefId;
use util::nodemap::{NodeMap, FnvHashSet}; use util::nodemap::{NodeMap, FnvHashSet};
use syntax::codemap::{self, mk_sp, respan, Span, Spanned, ExpnId}; use syntax_pos::{mk_sp, Span, ExpnId};
use syntax::codemap::{self, respan, Spanned};
use syntax::abi::Abi; use syntax::abi::Abi;
use syntax::ast::{Name, NodeId, DUMMY_NODE_ID, TokenTree, AsmDialect}; use syntax::ast::{Name, NodeId, DUMMY_NODE_ID, TokenTree, AsmDialect};
use syntax::ast::{Attribute, Lit, StrStyle, FloatTy, IntTy, UintTy, MetaItem}; use syntax::ast::{Attribute, Lit, StrStyle, FloatTy, IntTy, UintTy, MetaItem};

View file

@ -14,7 +14,8 @@ use hir::{self, PatKind};
use ty::TyCtxt; use ty::TyCtxt;
use util::nodemap::FnvHashMap; use util::nodemap::FnvHashMap;
use syntax::ast; use syntax::ast;
use syntax::codemap::{Span, Spanned, DUMMY_SP}; use syntax::codemap::Spanned;
use syntax_pos::{Span, DUMMY_SP};
use std::iter::{Enumerate, ExactSizeIterator}; use std::iter::{Enumerate, ExactSizeIterator};

View file

@ -12,8 +12,7 @@ pub use self::AnnNode::*;
use syntax::abi::Abi; use syntax::abi::Abi;
use syntax::ast; use syntax::ast;
use syntax::codemap::{self, CodeMap, BytePos, Spanned}; use syntax::codemap::{CodeMap, Spanned};
use syntax::errors;
use syntax::parse::token::{self, keywords, BinOpToken}; use syntax::parse::token::{self, keywords, BinOpToken};
use syntax::parse::lexer::comments; use syntax::parse::lexer::comments;
use syntax::print::pp::{self, break_offset, word, space, hardbreak}; use syntax::print::pp::{self, break_offset, word, space, hardbreak};
@ -21,6 +20,8 @@ use syntax::print::pp::{Breaks, eof};
use syntax::print::pp::Breaks::{Consistent, Inconsistent}; use syntax::print::pp::Breaks::{Consistent, Inconsistent};
use syntax::print::pprust::{self as ast_pp, PrintState}; use syntax::print::pprust::{self as ast_pp, PrintState};
use syntax::ptr::P; use syntax::ptr::P;
use syntax_pos::{self, BytePos};
use errors;
use hir; use hir;
use hir::{Crate, PatKind, RegionTyParamBound, SelfKind, TraitTyParamBound, TraitBoundModifier}; use hir::{Crate, PatKind, RegionTyParamBound, SelfKind, TraitTyParamBound, TraitBoundModifier};
@ -368,11 +369,11 @@ impl<'a> State<'a> {
self.end() // close the head-box self.end() // close the head-box
} }
pub fn bclose_(&mut self, span: codemap::Span, indented: usize) -> io::Result<()> { pub fn bclose_(&mut self, span: syntax_pos::Span, indented: usize) -> io::Result<()> {
self.bclose_maybe_open(span, indented, true) self.bclose_maybe_open(span, indented, true)
} }
pub fn bclose_maybe_open(&mut self, pub fn bclose_maybe_open(&mut self,
span: codemap::Span, span: syntax_pos::Span,
indented: usize, indented: usize,
close_box: bool) close_box: bool)
-> io::Result<()> { -> io::Result<()> {
@ -384,7 +385,7 @@ impl<'a> State<'a> {
} }
Ok(()) Ok(())
} }
pub fn bclose(&mut self, span: codemap::Span) -> io::Result<()> { pub fn bclose(&mut self, span: syntax_pos::Span) -> io::Result<()> {
self.bclose_(span, indent_unit) self.bclose_(span, indent_unit)
} }
@ -432,7 +433,7 @@ impl<'a> State<'a> {
mut get_span: G) mut get_span: G)
-> io::Result<()> -> io::Result<()>
where F: FnMut(&mut State, &T) -> io::Result<()>, where F: FnMut(&mut State, &T) -> io::Result<()>,
G: FnMut(&T) -> codemap::Span G: FnMut(&T) -> syntax_pos::Span
{ {
self.rbox(0, b)?; self.rbox(0, b)?;
let len = elts.len(); let len = elts.len();
@ -859,7 +860,7 @@ impl<'a> State<'a> {
enum_definition: &hir::EnumDef, enum_definition: &hir::EnumDef,
generics: &hir::Generics, generics: &hir::Generics,
name: ast::Name, name: ast::Name,
span: codemap::Span, span: syntax_pos::Span,
visibility: &hir::Visibility) visibility: &hir::Visibility)
-> io::Result<()> { -> io::Result<()> {
self.head(&visibility_qualified(visibility, "enum"))?; self.head(&visibility_qualified(visibility, "enum"))?;
@ -872,7 +873,7 @@ impl<'a> State<'a> {
pub fn print_variants(&mut self, pub fn print_variants(&mut self,
variants: &[hir::Variant], variants: &[hir::Variant],
span: codemap::Span) span: syntax_pos::Span)
-> io::Result<()> { -> io::Result<()> {
self.bopen()?; self.bopen()?;
for v in variants { for v in variants {
@ -902,7 +903,7 @@ impl<'a> State<'a> {
struct_def: &hir::VariantData, struct_def: &hir::VariantData,
generics: &hir::Generics, generics: &hir::Generics,
name: ast::Name, name: ast::Name,
span: codemap::Span, span: syntax_pos::Span,
print_finalizer: bool) print_finalizer: bool)
-> io::Result<()> { -> io::Result<()> {
self.print_name(name)?; self.print_name(name)?;
@ -2237,7 +2238,7 @@ impl<'a> State<'a> {
} }
pub fn maybe_print_trailing_comment(&mut self, pub fn maybe_print_trailing_comment(&mut self,
span: codemap::Span, span: syntax_pos::Span,
next_pos: Option<BytePos>) next_pos: Option<BytePos>)
-> io::Result<()> { -> io::Result<()> {
let cm = match self.cm { let cm = match self.cm {

View file

@ -49,7 +49,7 @@ use ty::relate::{RelateResult, TypeRelation};
use traits::PredicateObligations; use traits::PredicateObligations;
use syntax::ast; use syntax::ast;
use syntax::codemap::Span; use syntax_pos::Span;
#[derive(Clone)] #[derive(Clone)]
pub struct CombineFields<'a, 'gcx: 'a+'tcx, 'tcx: 'a> { pub struct CombineFields<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {

View file

@ -91,10 +91,10 @@ use std::cell::{Cell, RefCell};
use std::char::from_u32; use std::char::from_u32;
use std::fmt; use std::fmt;
use syntax::ast; use syntax::ast;
use syntax::errors::{DiagnosticBuilder, check_old_skool};
use syntax::codemap::{self, Pos, Span};
use syntax::parse::token; use syntax::parse::token;
use syntax::ptr::P; use syntax::ptr::P;
use syntax_pos::{self, Pos, Span};
use errors::{DiagnosticBuilder, check_old_skool};
impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
pub fn note_and_explain_region(self, pub fn note_and_explain_region(self,
@ -1933,6 +1933,6 @@ impl LifeGiver {
fn name_to_dummy_lifetime(name: ast::Name) -> hir::Lifetime { fn name_to_dummy_lifetime(name: ast::Name) -> hir::Lifetime {
hir::Lifetime { id: ast::DUMMY_NODE_ID, hir::Lifetime { id: ast::DUMMY_NODE_ID,
span: codemap::DUMMY_SP, span: syntax_pos::DUMMY_SP,
name: name } name: name }
} }

View file

@ -23,7 +23,7 @@ use super::region_inference::{TaintDirections};
use ty::{self, TyCtxt, Binder, TypeFoldable}; use ty::{self, TyCtxt, Binder, TypeFoldable};
use ty::error::TypeError; use ty::error::TypeError;
use ty::relate::{Relate, RelateResult, TypeRelation}; use ty::relate::{Relate, RelateResult, TypeRelation};
use syntax::codemap::Span; use syntax_pos::Span;
use util::nodemap::{FnvHashMap, FnvHashSet}; use util::nodemap::{FnvHashMap, FnvHashSet};
pub struct HrMatchResult<U> { pub struct HrMatchResult<U> {

View file

@ -39,9 +39,8 @@ use rustc_data_structures::unify::{self, UnificationTable};
use std::cell::{Cell, RefCell, Ref, RefMut}; use std::cell::{Cell, RefCell, Ref, RefMut};
use std::fmt; use std::fmt;
use syntax::ast; use syntax::ast;
use syntax::codemap; use errors::DiagnosticBuilder;
use syntax::codemap::{Span, DUMMY_SP}; use syntax_pos::{self, Span, DUMMY_SP};
use syntax::errors::DiagnosticBuilder;
use util::nodemap::{FnvHashMap, FnvHashSet, NodeMap}; use util::nodemap::{FnvHashMap, FnvHashSet, NodeMap};
use self::combine::CombineFields; use self::combine::CombineFields;
@ -1036,7 +1035,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
-> UnitResult<'tcx> -> UnitResult<'tcx>
{ {
self.probe(|_| { self.probe(|_| {
let origin = TypeOrigin::Misc(codemap::DUMMY_SP); let origin = TypeOrigin::Misc(syntax_pos::DUMMY_SP);
let trace = TypeTrace::types(origin, true, a, b); let trace = TypeTrace::types(origin, true, a, b);
self.sub(true, trace, &a, &b).map(|_| ()) self.sub(true, trace, &a, &b).map(|_| ())
}) })
@ -1813,7 +1812,7 @@ impl<'a, 'gcx, 'tcx> TypeTrace<'tcx> {
pub fn dummy(tcx: TyCtxt<'a, 'gcx, 'tcx>) -> TypeTrace<'tcx> { pub fn dummy(tcx: TyCtxt<'a, 'gcx, 'tcx>) -> TypeTrace<'tcx> {
TypeTrace { TypeTrace {
origin: TypeOrigin::Misc(codemap::DUMMY_SP), origin: TypeOrigin::Misc(syntax_pos::DUMMY_SP),
values: Types(ExpectedFound { values: Types(ExpectedFound {
expected: tcx.types.err, expected: tcx.types.err,
found: tcx.types.err, found: tcx.types.err,
@ -1887,7 +1886,7 @@ impl RegionVariableOrigin {
Coercion(a) => a, Coercion(a) => a,
EarlyBoundRegion(a, _) => a, EarlyBoundRegion(a, _) => a,
LateBoundRegion(a, _, _) => a, LateBoundRegion(a, _, _) => a,
BoundRegionInCoherence(_) => codemap::DUMMY_SP, BoundRegionInCoherence(_) => syntax_pos::DUMMY_SP,
UpvarRegion(_, a) => a UpvarRegion(_, a) => a
} }
} }

View file

@ -13,7 +13,7 @@ use self::TypeVariableValue::*;
use self::UndoEntry::*; use self::UndoEntry::*;
use hir::def_id::{DefId}; use hir::def_id::{DefId};
use ty::{self, Ty}; use ty::{self, Ty};
use syntax::codemap::Span; use syntax_pos::Span;
use std::cmp::min; use std::cmp::min;
use std::marker::PhantomData; use std::marker::PhantomData;

View file

@ -55,8 +55,10 @@ extern crate rustc_data_structures;
extern crate serialize; extern crate serialize;
extern crate collections; extern crate collections;
extern crate rustc_const_math; extern crate rustc_const_math;
extern crate rustc_errors as errors;
#[macro_use] extern crate log; #[macro_use] extern crate log;
#[macro_use] extern crate syntax; #[macro_use] extern crate syntax;
#[macro_use] extern crate syntax_pos;
#[macro_use] #[no_link] extern crate rustc_bitflags; #[macro_use] #[no_link] extern crate rustc_bitflags;
extern crate serialize as rustc_serialize; // used by deriving extern crate serialize as rustc_serialize; // used by deriving

View file

@ -40,11 +40,11 @@ use std::cmp;
use std::default::Default as StdDefault; use std::default::Default as StdDefault;
use std::mem; use std::mem;
use syntax::attr::{self, AttrMetaMethods}; use syntax::attr::{self, AttrMetaMethods};
use syntax::codemap::Span;
use syntax::errors::DiagnosticBuilder;
use syntax::parse::token::InternedString; use syntax::parse::token::InternedString;
use syntax::ast; use syntax::ast;
use syntax::attr::ThinAttributesExt; use syntax::attr::ThinAttributesExt;
use syntax_pos::Span;
use errors::DiagnosticBuilder;
use hir; use hir;
use hir::intravisit as hir_visit; use hir::intravisit as hir_visit;
use hir::intravisit::{IdVisitor, IdVisitingOperation}; use hir::intravisit::{IdVisitor, IdVisitingOperation};

View file

@ -33,7 +33,7 @@ pub use self::LintSource::*;
use std::hash; use std::hash;
use std::ascii::AsciiExt; use std::ascii::AsciiExt;
use syntax::codemap::Span; use syntax_pos::Span;
use hir::intravisit::FnKind; use hir::intravisit::FnKind;
use syntax::visit as ast_visit; use syntax::visit as ast_visit;
use syntax::ast; use syntax::ast;

View file

@ -17,7 +17,7 @@
use hir::def::Def; use hir::def::Def;
use ty::{Ty, TyCtxt}; use ty::{Ty, TyCtxt};
use syntax::codemap::Span; use syntax_pos::Span;
use hir as ast; use hir as ast;
impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {

View file

@ -39,9 +39,9 @@ use std::rc::Rc;
use std::path::PathBuf; use std::path::PathBuf;
use syntax::ast; use syntax::ast;
use syntax::attr; use syntax::attr;
use syntax::codemap::Span;
use syntax::ptr::P; use syntax::ptr::P;
use syntax::parse::token::InternedString; use syntax::parse::token::InternedString;
use syntax_pos::Span;
use rustc_back::target::Target; use rustc_back::target::Target;
use hir; use hir;
use hir::intravisit::{IdVisitor, IdVisitingOperation, Visitor}; use hir::intravisit::{IdVisitor, IdVisitingOperation, Visitor};

View file

@ -26,6 +26,7 @@ use lint;
use std::collections::HashSet; use std::collections::HashSet;
use syntax::{ast, codemap}; use syntax::{ast, codemap};
use syntax::attr; use syntax::attr;
use syntax_pos;
// Any local node that may call something in its body block should be // Any local node that may call something in its body block should be
// explored. For example, if it's a live NodeItem that is a // explored. For example, if it's a live NodeItem that is a
@ -215,7 +216,7 @@ impl<'a, 'tcx> MarkSymbolVisitor<'a, 'tcx> {
impl<'a, 'tcx, 'v> Visitor<'v> for MarkSymbolVisitor<'a, 'tcx> { impl<'a, 'tcx, 'v> Visitor<'v> for MarkSymbolVisitor<'a, 'tcx> {
fn visit_variant_data(&mut self, def: &hir::VariantData, _: ast::Name, fn visit_variant_data(&mut self, def: &hir::VariantData, _: ast::Name,
_: &hir::Generics, _: ast::NodeId, _: codemap::Span) { _: &hir::Generics, _: ast::NodeId, _: syntax_pos::Span) {
let has_extern_repr = self.struct_has_extern_repr; let has_extern_repr = self.struct_has_extern_repr;
let inherited_pub_visibility = self.inherited_pub_visibility; let inherited_pub_visibility = self.inherited_pub_visibility;
let live_fields = def.fields().iter().filter(|f| { let live_fields = def.fields().iter().filter(|f| {
@ -478,7 +479,7 @@ impl<'a, 'tcx> DeadVisitor<'a, 'tcx> {
fn warn_dead_code(&mut self, fn warn_dead_code(&mut self,
id: ast::NodeId, id: ast::NodeId,
span: codemap::Span, span: syntax_pos::Span,
name: ast::Name, name: ast::Name,
node_type: &str) { node_type: &str) {
let name = name.as_str(); let name = name.as_str();

View file

@ -18,7 +18,7 @@ use ty::{self, Ty, TyCtxt};
use ty::MethodCall; use ty::MethodCall;
use syntax::ast; use syntax::ast;
use syntax::codemap::Span; use syntax_pos::Span;
use hir; use hir;
use hir::intravisit; use hir::intravisit;
use hir::intravisit::{FnKind, Visitor}; use hir::intravisit::{FnKind, Visitor};

View file

@ -15,8 +15,8 @@ use hir::def_id::{CRATE_DEF_INDEX};
use session::{config, Session}; use session::{config, Session};
use syntax::ast::NodeId; use syntax::ast::NodeId;
use syntax::attr; use syntax::attr;
use syntax::codemap::Span;
use syntax::entry::EntryPointType; use syntax::entry::EntryPointType;
use syntax_pos::Span;
use hir::{Item, ItemFn}; use hir::{Item, ItemFn};
use hir::intravisit::Visitor; use hir::intravisit::Visitor;

View file

@ -30,7 +30,7 @@ use hir::{self, PatKind};
use syntax::ast; use syntax::ast;
use syntax::ptr::P; use syntax::ptr::P;
use syntax::codemap::Span; use syntax_pos::Span;
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// The Delegate trait // The Delegate trait

View file

@ -18,7 +18,7 @@ use ty::layout::{LayoutError, Pointer, SizeSkeleton};
use syntax::abi::Abi::RustIntrinsic; use syntax::abi::Abi::RustIntrinsic;
use syntax::ast; use syntax::ast;
use syntax::codemap::Span; use syntax_pos::Span;
use hir::intravisit::{self, Visitor, FnKind}; use hir::intravisit::{self, Visitor, FnKind};
use hir; use hir;

View file

@ -123,9 +123,10 @@ use std::io::prelude::*;
use std::io; use std::io;
use std::rc::Rc; use std::rc::Rc;
use syntax::ast::{self, NodeId}; use syntax::ast::{self, NodeId};
use syntax::codemap::{BytePos, original_sp, Span}; use syntax::codemap::original_sp;
use syntax::parse::token::keywords; use syntax::parse::token::keywords;
use syntax::ptr::P; use syntax::ptr::P;
use syntax_pos::{BytePos, Span};
use hir::Expr; use hir::Expr;
use hir; use hir;

View file

@ -83,7 +83,7 @@ use hir::{MutImmutable, MutMutable, PatKind};
use hir::pat_util::EnumerateAndAdjustIterator; use hir::pat_util::EnumerateAndAdjustIterator;
use hir; use hir;
use syntax::ast; use syntax::ast;
use syntax::codemap::Span; use syntax_pos::Span;
use std::fmt; use std::fmt;
use std::rc::Rc; use std::rc::Rc;

View file

@ -27,8 +27,9 @@ use std::cell::RefCell;
use std::collections::hash_map::Entry; use std::collections::hash_map::Entry;
use std::fmt; use std::fmt;
use std::mem; use std::mem;
use syntax::codemap::{self, Span}; use syntax::codemap;
use syntax::ast::{self, NodeId}; use syntax::ast::{self, NodeId};
use syntax_pos::Span;
use hir; use hir;
use hir::intravisit::{self, Visitor, FnKind}; use hir::intravisit::{self, Visitor, FnKind};

View file

@ -29,8 +29,8 @@ use ty;
use std::fmt; use std::fmt;
use std::mem::replace; use std::mem::replace;
use syntax::ast; use syntax::ast;
use syntax::codemap::Span;
use syntax::parse::token::keywords; use syntax::parse::token::keywords;
use syntax_pos::Span;
use util::nodemap::NodeMap; use util::nodemap::NodeMap;
use rustc_data_structures::fnv::FnvHashSet; use rustc_data_structures::fnv::FnvHashSet;

View file

@ -23,7 +23,7 @@ use hir::def_id::{CRATE_DEF_INDEX, DefId};
use ty::{self, TyCtxt}; use ty::{self, TyCtxt};
use middle::privacy::AccessLevels; use middle::privacy::AccessLevels;
use syntax::parse::token::InternedString; use syntax::parse::token::InternedString;
use syntax::codemap::{Span, DUMMY_SP}; use syntax_pos::{Span, DUMMY_SP};
use syntax::ast; use syntax::ast;
use syntax::ast::{NodeId, Attribute}; use syntax::ast::{NodeId, Attribute};
use syntax::feature_gate::{GateIssue, emit_feature_err, find_lang_feature_accepted_version}; use syntax::feature_gate::{GateIssue, emit_feature_err, find_lang_feature_accepted_version};

View file

@ -15,8 +15,8 @@ use session::Session;
use middle::lang_items; use middle::lang_items;
use syntax::ast; use syntax::ast;
use syntax::codemap::Span;
use syntax::parse::token::InternedString; use syntax::parse::token::InternedString;
use syntax_pos::Span;
use hir::intravisit::Visitor; use hir::intravisit::Visitor;
use hir::intravisit; use hir::intravisit;
use hir; use hir;

View file

@ -25,7 +25,7 @@ use std::fmt::{self, Debug, Formatter, Write};
use std::{iter, u32}; use std::{iter, u32};
use std::ops::{Index, IndexMut}; use std::ops::{Index, IndexMut};
use syntax::ast::{self, Name}; use syntax::ast::{self, Name};
use syntax::codemap::Span; use syntax_pos::Span;
use super::cache::Cache; use super::cache::Cache;

View file

@ -16,7 +16,7 @@ use mir::repr::*;
use rustc_const_math::ConstUsize; use rustc_const_math::ConstUsize;
use rustc_data_structures::tuple_slice::TupleSlice; use rustc_data_structures::tuple_slice::TupleSlice;
use rustc_data_structures::indexed_vec::Idx; use rustc_data_structures::indexed_vec::Idx;
use syntax::codemap::Span; use syntax_pos::Span;
// # The MIR Visitor // # The MIR Visitor
// //

View file

@ -26,11 +26,12 @@ use middle::cstore;
use syntax::ast::{self, IntTy, UintTy}; use syntax::ast::{self, IntTy, UintTy};
use syntax::attr; use syntax::attr;
use syntax::attr::AttrMetaMethods; use syntax::attr::AttrMetaMethods;
use syntax::errors::{ColorConfig, Handler};
use syntax::parse; use syntax::parse;
use syntax::parse::token::InternedString; use syntax::parse::token::InternedString;
use syntax::feature_gate::UnstableFeatures; use syntax::feature_gate::UnstableFeatures;
use errors::{ColorConfig, Handler};
use getopts; use getopts;
use std::collections::HashMap; use std::collections::HashMap;
use std::env; use std::env;

View file

@ -21,17 +21,16 @@ use util::nodemap::{NodeMap, FnvHashMap};
use mir::transform as mir_pass; use mir::transform as mir_pass;
use syntax::ast::{NodeId, NodeIdAssigner, Name}; use syntax::ast::{NodeId, NodeIdAssigner, Name};
use syntax::codemap::{Span, MultiSpan}; use errors::{self, DiagnosticBuilder};
use syntax::errors::{self, DiagnosticBuilder}; use errors::emitter::{Emitter, BasicEmitter, EmitterWriter};
use syntax::errors::emitter::{Emitter, BasicEmitter, EmitterWriter}; use syntax::json::JsonEmitter;
use syntax::errors::json::JsonEmitter;
use syntax::diagnostics;
use syntax::feature_gate; use syntax::feature_gate;
use syntax::parse; use syntax::parse;
use syntax::parse::ParseSess; use syntax::parse::ParseSess;
use syntax::parse::token; use syntax::parse::token;
use syntax::{ast, codemap}; use syntax::{ast, codemap};
use syntax::feature_gate::AttributeType; use syntax::feature_gate::AttributeType;
use syntax_pos::{Span, MultiSpan};
use rustc_back::target::Target; use rustc_back::target::Target;
use llvm; use llvm;
@ -424,7 +423,7 @@ fn split_msg_into_multilines(msg: &str) -> Option<String> {
pub fn build_session(sopts: config::Options, pub fn build_session(sopts: config::Options,
dep_graph: &DepGraph, dep_graph: &DepGraph,
local_crate_source_file: Option<PathBuf>, local_crate_source_file: Option<PathBuf>,
registry: diagnostics::registry::Registry, registry: errors::registry::Registry,
cstore: Rc<for<'a> CrateStore<'a>>) cstore: Rc<for<'a> CrateStore<'a>>)
-> Session { -> Session {
build_session_with_codemap(sopts, build_session_with_codemap(sopts,
@ -438,7 +437,7 @@ pub fn build_session(sopts: config::Options,
pub fn build_session_with_codemap(sopts: config::Options, pub fn build_session_with_codemap(sopts: config::Options,
dep_graph: &DepGraph, dep_graph: &DepGraph,
local_crate_source_file: Option<PathBuf>, local_crate_source_file: Option<PathBuf>,
registry: diagnostics::registry::Registry, registry: errors::registry::Registry,
cstore: Rc<for<'a> CrateStore<'a>>, cstore: Rc<for<'a> CrateStore<'a>>,
codemap: Rc<codemap::CodeMap>) codemap: Rc<codemap::CodeMap>)
-> Session { -> Session {

View file

@ -17,7 +17,7 @@ use hir::def_id::DefId;
use ty::subst::TypeSpace; use ty::subst::TypeSpace;
use ty::{self, Ty, TyCtxt}; use ty::{self, Ty, TyCtxt};
use infer::{InferCtxt, TypeOrigin}; use infer::{InferCtxt, TypeOrigin};
use syntax::codemap::DUMMY_SP; use syntax_pos::DUMMY_SP;
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
struct InferIsLocal(bool); struct InferIsLocal(bool);

View file

@ -37,8 +37,8 @@ use std::cmp;
use std::fmt; use std::fmt;
use syntax::ast; use syntax::ast;
use syntax::attr::{AttributeMethods, AttrMetaMethods}; use syntax::attr::{AttributeMethods, AttrMetaMethods};
use syntax::codemap::Span; use syntax_pos::Span;
use syntax::errors::DiagnosticBuilder; use errors::DiagnosticBuilder;
#[derive(Debug, PartialEq, Eq, Hash)] #[derive(Debug, PartialEq, Eq, Hash)]
pub struct TraitErrorKey<'tcx> { pub struct TraitErrorKey<'tcx> {

View file

@ -23,7 +23,7 @@ use infer::InferCtxt;
use std::rc::Rc; use std::rc::Rc;
use syntax::ast; use syntax::ast;
use syntax::codemap::{Span, DUMMY_SP}; use syntax_pos::{Span, DUMMY_SP};
pub use self::error_reporting::TraitErrorKey; pub use self::error_reporting::TraitErrorKey;
pub use self::coherence::orphan_check; pub use self::coherence::orphan_check;

View file

@ -27,7 +27,7 @@ use middle::region;
use ty::subst::{Subst, Substs}; use ty::subst::{Subst, Substs};
use traits::{self, ProjectionMode, ObligationCause, Normalized}; use traits::{self, ProjectionMode, ObligationCause, Normalized};
use ty::{self, TyCtxt}; use ty::{self, TyCtxt};
use syntax::codemap::DUMMY_SP; use syntax_pos::DUMMY_SP;
pub mod specialization_graph; pub mod specialization_graph;

View file

@ -12,7 +12,7 @@ use hir::def_id::DefId;
use infer::InferCtxt; use infer::InferCtxt;
use ty::subst::{Subst, Substs}; use ty::subst::{Subst, Substs};
use ty::{self, Ty, TyCtxt, ToPredicate, ToPolyTraitRef}; use ty::{self, Ty, TyCtxt, ToPredicate, ToPolyTraitRef};
use syntax::codemap::Span; use syntax_pos::Span;
use util::common::ErrorReported; use util::common::ErrorReported;
use util::nodemap::FnvHashSet; use util::nodemap::FnvHashSet;

View file

@ -15,7 +15,7 @@ use ty::{self, Ty, TyCtxt, TypeAndMut, TypeFoldable};
use ty::LvaluePreference::{NoPreference}; use ty::LvaluePreference::{NoPreference};
use syntax::ast; use syntax::ast;
use syntax::codemap::Span; use syntax_pos::Span;
use hir; use hir;

View file

@ -862,7 +862,7 @@ pub mod tls {
use std::cell::Cell; use std::cell::Cell;
use std::fmt; use std::fmt;
use syntax::codemap; use syntax_pos;
/// Marker types used for the scoped TLS slot. /// Marker types used for the scoped TLS slot.
/// The type context cannot be used directly because the scoped TLS /// The type context cannot be used directly because the scoped TLS
@ -875,7 +875,7 @@ pub mod tls {
*const ThreadLocalInterners)>> = Cell::new(None) *const ThreadLocalInterners)>> = Cell::new(None)
} }
fn span_debug(span: codemap::Span, f: &mut fmt::Formatter) -> fmt::Result { fn span_debug(span: syntax_pos::Span, f: &mut fmt::Formatter) -> fmt::Result {
with(|tcx| { with(|tcx| {
write!(f, "{}", tcx.sess.codemap().span_to_string(span)) write!(f, "{}", tcx.sess.codemap().span_to_string(span))
}) })
@ -884,7 +884,7 @@ pub mod tls {
pub fn enter_global<'gcx, F, R>(gcx: GlobalCtxt<'gcx>, f: F) -> R pub fn enter_global<'gcx, F, R>(gcx: GlobalCtxt<'gcx>, f: F) -> R
where F: for<'a> FnOnce(TyCtxt<'a, 'gcx, 'gcx>) -> R where F: for<'a> FnOnce(TyCtxt<'a, 'gcx, 'gcx>) -> R
{ {
codemap::SPAN_DEBUG.with(|span_dbg| { syntax_pos::SPAN_DEBUG.with(|span_dbg| {
let original_span_debug = span_dbg.get(); let original_span_debug = span_dbg.get();
span_dbg.set(span_debug); span_dbg.set(span_debug);
let result = enter(&gcx, &gcx.global_interners, f); let result = enter(&gcx, &gcx.global_interners, f);

View file

@ -16,8 +16,8 @@ use ty::{self, BoundRegion, Region, Ty, TyCtxt};
use std::fmt; use std::fmt;
use syntax::abi; use syntax::abi;
use syntax::ast::{self, Name}; use syntax::ast::{self, Name};
use syntax::codemap::Span; use errors::DiagnosticBuilder;
use syntax::errors::DiagnosticBuilder; use syntax_pos::Span;
use hir; use hir;

View file

@ -21,7 +21,7 @@ use util::common::slice_pat;
use syntax::ast::{FloatTy, IntTy, UintTy}; use syntax::ast::{FloatTy, IntTy, UintTy};
use syntax::attr; use syntax::attr;
use syntax::codemap::DUMMY_SP; use syntax_pos::DUMMY_SP;
use std::cmp; use std::cmp;
use std::fmt; use std::fmt;

View file

@ -44,8 +44,8 @@ use std::slice;
use std::vec::IntoIter; use std::vec::IntoIter;
use syntax::ast::{self, CrateNum, Name, NodeId}; use syntax::ast::{self, CrateNum, Name, NodeId};
use syntax::attr::{self, AttrMetaMethods}; use syntax::attr::{self, AttrMetaMethods};
use syntax::codemap::{DUMMY_SP, Span};
use syntax::parse::token::InternedString; use syntax::parse::token::InternedString;
use syntax_pos::{DUMMY_SP, Span};
use rustc_const_math::ConstInt; use rustc_const_math::ConstInt;

View file

@ -22,7 +22,7 @@ use std::fmt;
use std::iter::IntoIterator; use std::iter::IntoIterator;
use std::slice::Iter; use std::slice::Iter;
use std::vec::{Vec, IntoIter}; use std::vec::{Vec, IntoIter};
use syntax::codemap::{Span, DUMMY_SP}; use syntax_pos::{Span, DUMMY_SP};
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////

View file

@ -27,7 +27,7 @@ use std::cmp;
use std::hash::{Hash, SipHasher, Hasher}; use std::hash::{Hash, SipHasher, Hasher};
use syntax::ast::{self, Name}; use syntax::ast::{self, Name};
use syntax::attr::{self, SignedInt, UnsignedInt}; use syntax::attr::{self, SignedInt, UnsignedInt};
use syntax::codemap::Span; use syntax_pos::Span;
use hir; use hir;

View file

@ -16,7 +16,7 @@ use traits;
use ty::{self, ToPredicate, Ty, TyCtxt, TypeFoldable}; use ty::{self, ToPredicate, Ty, TyCtxt, TypeFoldable};
use std::iter::once; use std::iter::once;
use syntax::ast; use syntax::ast;
use syntax::codemap::Span; use syntax_pos::Span;
use util::common::ErrorReported; use util::common::ErrorReported;
/// Returns the set of obligations needed to make `ty` well-formed. /// Returns the set of obligations needed to make `ty` well-formed.

View file

@ -12,6 +12,7 @@ test = false
[dependencies] [dependencies]
log = { path = "../liblog" } log = { path = "../liblog" }
syntax = { path = "../libsyntax" } syntax = { path = "../libsyntax" }
syntax_pos = { path = "../libsyntax_pos" }
graphviz = { path = "../libgraphviz" } graphviz = { path = "../libgraphviz" }
rustc = { path = "../librustc" } rustc = { path = "../librustc" }
rustc_data_structures = { path = "../librustc_data_structures" } rustc_data_structures = { path = "../librustc_data_structures" }

View file

@ -27,7 +27,7 @@ use rustc::middle::mem_categorization::Categorization;
use rustc::middle::region; use rustc::middle::region;
use rustc::ty::{self, TyCtxt}; use rustc::ty::{self, TyCtxt};
use syntax::ast; use syntax::ast;
use syntax::codemap::Span; use syntax_pos::Span;
use rustc::hir; use rustc::hir;
use std::rc::Rc; use std::rc::Rc;

View file

@ -27,8 +27,8 @@ use rustc::middle::mem_categorization as mc;
use std::mem; use std::mem;
use std::rc::Rc; use std::rc::Rc;
use syntax::ast; use syntax::ast;
use syntax::codemap::{Span, DUMMY_SP};
use syntax::attr::AttrMetaMethods; use syntax::attr::AttrMetaMethods;
use syntax_pos::{Span, DUMMY_SP};
#[derive(PartialEq, Eq, PartialOrd, Ord)] #[derive(PartialEq, Eq, PartialOrd, Ord)]
enum Fragment { enum Fragment {

View file

@ -22,7 +22,7 @@ use rustc::ty;
use std::rc::Rc; use std::rc::Rc;
use syntax::ast; use syntax::ast;
use syntax::codemap::Span; use syntax_pos::Span;
use rustc::hir::{self, PatKind}; use rustc::hir::{self, PatKind};
struct GatherMoveInfo<'tcx> { struct GatherMoveInfo<'tcx> {

View file

@ -19,7 +19,7 @@ use rustc::middle::region;
use rustc::ty; use rustc::ty;
use syntax::ast; use syntax::ast;
use syntax::codemap::Span; use syntax_pos::Span;
type R = Result<(),()>; type R = Result<(),()>;

View file

@ -25,8 +25,8 @@ use rustc::middle::region;
use rustc::ty::{self, TyCtxt}; use rustc::ty::{self, TyCtxt};
use syntax::ast; use syntax::ast;
use syntax::codemap::Span;
use syntax::ast::NodeId; use syntax::ast::NodeId;
use syntax_pos::Span;
use rustc::hir; use rustc::hir;
use rustc::hir::Expr; use rustc::hir::Expr;
use rustc::hir::intravisit; use rustc::hir::intravisit;

View file

@ -14,8 +14,8 @@ use rustc::middle::mem_categorization::Categorization;
use rustc::middle::mem_categorization::InteriorOffsetKind as Kind; use rustc::middle::mem_categorization::InteriorOffsetKind as Kind;
use rustc::ty; use rustc::ty;
use syntax::ast; use syntax::ast;
use syntax::codemap; use syntax_pos;
use syntax::errors::DiagnosticBuilder; use errors::DiagnosticBuilder;
use rustc::hir; use rustc::hir;
pub struct MoveErrorCollector<'tcx> { pub struct MoveErrorCollector<'tcx> {
@ -56,7 +56,7 @@ impl<'tcx> MoveError<'tcx> {
#[derive(Clone)] #[derive(Clone)]
pub struct MoveSpanAndPath { pub struct MoveSpanAndPath {
pub span: codemap::Span, pub span: syntax_pos::Span,
pub name: ast::Name, pub name: ast::Name,
} }
@ -169,7 +169,7 @@ fn report_cannot_move_out_of<'a, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
} }
fn note_move_destination(mut err: DiagnosticBuilder, fn note_move_destination(mut err: DiagnosticBuilder,
move_to_span: codemap::Span, move_to_span: syntax_pos::Span,
pat_name: ast::Name, pat_name: ast::Name,
is_first_note: bool) -> DiagnosticBuilder { is_first_note: bool) -> DiagnosticBuilder {
if is_first_note { if is_first_note {

View file

@ -15,7 +15,7 @@ use rustc::middle::expr_use_visitor as euv;
use rustc::middle::mem_categorization as mc; use rustc::middle::mem_categorization as mc;
use rustc::middle::mem_categorization::Categorization; use rustc::middle::mem_categorization::Categorization;
use rustc::ty; use rustc::ty;
use syntax::codemap::Span; use syntax_pos::Span;
use borrowck::ToInteriorKind; use borrowck::ToInteriorKind;

View file

@ -10,7 +10,7 @@
use syntax::abi::{Abi}; use syntax::abi::{Abi};
use syntax::ast; use syntax::ast;
use syntax::codemap::Span; use syntax_pos::Span;
use rustc::ty::{self, TyCtxt}; use rustc::ty::{self, TyCtxt};
use rustc::mir::repr::{self, Mir}; use rustc::mir::repr::{self, Mir};

View file

@ -23,7 +23,7 @@ use rustc::middle::const_val::ConstVal;
use rustc::middle::lang_items; use rustc::middle::lang_items;
use rustc::util::nodemap::FnvHashMap; use rustc::util::nodemap::FnvHashMap;
use rustc_data_structures::indexed_vec::Idx; use rustc_data_structures::indexed_vec::Idx;
use syntax::codemap::Span; use syntax_pos::Span;
use std::fmt; use std::fmt;
use std::u32; use std::u32;

View file

@ -12,8 +12,8 @@ use borrowck::BorrowckCtxt;
use syntax::ast::{self, MetaItem}; use syntax::ast::{self, MetaItem};
use syntax::attr::AttrMetaMethods; use syntax::attr::AttrMetaMethods;
use syntax::codemap::{Span, DUMMY_SP};
use syntax::ptr::P; use syntax::ptr::P;
use syntax_pos::{Span, DUMMY_SP};
use rustc::hir; use rustc::hir;
use rustc::hir::intravisit::{FnKind}; use rustc::hir::intravisit::{FnKind};

View file

@ -43,8 +43,8 @@ use std::mem;
use std::rc::Rc; use std::rc::Rc;
use syntax::ast; use syntax::ast;
use syntax::attr::AttrMetaMethods; use syntax::attr::AttrMetaMethods;
use syntax::codemap::{MultiSpan, Span}; use syntax_pos::{MultiSpan, Span};
use syntax::errors::DiagnosticBuilder; use errors::DiagnosticBuilder;
use rustc::hir; use rustc::hir;
use rustc::hir::{FnDecl, Block}; use rustc::hir::{FnDecl, Block};

View file

@ -28,7 +28,7 @@ use std::cell::RefCell;
use std::rc::Rc; use std::rc::Rc;
use std::usize; use std::usize;
use syntax::ast; use syntax::ast;
use syntax::codemap::Span; use syntax_pos::Span;
use rustc::hir; use rustc::hir;
use rustc::hir::intravisit::IdRange; use rustc::hir::intravisit::IdRange;

View file

@ -28,6 +28,8 @@
#![feature(question_mark)] #![feature(question_mark)]
#[macro_use] extern crate log; #[macro_use] extern crate log;
#[macro_use] extern crate syntax; #[macro_use] extern crate syntax;
extern crate syntax_pos;
extern crate rustc_errors as errors;
// for "clarity", rename the graphviz crate to dot; graphviz within `borrowck` // for "clarity", rename the graphviz crate to dot; graphviz within `borrowck`
// refers to the borrowck-specific graphviz adapter traits. // refers to the borrowck-specific graphviz adapter traits.

View file

@ -16,3 +16,4 @@ rustc_back = { path = "../librustc_back" }
rustc_const_math = { path = "../librustc_const_math" } rustc_const_math = { path = "../librustc_const_math" }
syntax = { path = "../libsyntax" } syntax = { path = "../libsyntax" }
graphviz = { path = "../libgraphviz" } graphviz = { path = "../libgraphviz" }
syntax_pos = { path = "../libsyntax_pos" }

View file

@ -37,7 +37,8 @@ use rustc::hir::intravisit::{self, IdVisitor, IdVisitingOperation, Visitor, FnKi
use rustc_back::slice; use rustc_back::slice;
use syntax::ast::{self, DUMMY_NODE_ID, NodeId}; use syntax::ast::{self, DUMMY_NODE_ID, NodeId};
use syntax::codemap::{Span, Spanned, DUMMY_SP}; use syntax::codemap::Spanned;
use syntax_pos::{Span, DUMMY_SP};
use rustc::hir::fold::{Folder, noop_fold_pat}; use rustc::hir::fold::{Folder, noop_fold_pat};
use rustc::hir::print::pat_to_string; use rustc::hir::print::pat_to_string;
use syntax::ptr::P; use syntax::ptr::P;

View file

@ -33,10 +33,10 @@ use syntax::ast;
use rustc::hir::{Expr, PatKind}; use rustc::hir::{Expr, PatKind};
use rustc::hir; use rustc::hir;
use rustc::hir::intravisit::FnKind; use rustc::hir::intravisit::FnKind;
use syntax::codemap::Span;
use syntax::ptr::P; use syntax::ptr::P;
use syntax::codemap; use syntax::codemap;
use syntax::attr::IntType; use syntax::attr::IntType;
use syntax_pos::{self, Span};
use std::borrow::Cow; use std::borrow::Cow;
use std::cmp::Ordering; use std::cmp::Ordering;
@ -301,7 +301,7 @@ pub fn const_expr_to_pat<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
let field_pats = let field_pats =
try!(fields.iter() try!(fields.iter()
.map(|field| Ok(codemap::Spanned { .map(|field| Ok(codemap::Spanned {
span: codemap::DUMMY_SP, span: syntax_pos::DUMMY_SP,
node: hir::FieldPat { node: hir::FieldPat {
name: field.name.node, name: field.name.node,
pat: try!(const_expr_to_pat(tcx, &field.expr, pat: try!(const_expr_to_pat(tcx, &field.expr,

View file

@ -38,7 +38,7 @@
extern crate rustc_back; extern crate rustc_back;
extern crate rustc_const_math; extern crate rustc_const_math;
extern crate graphviz; extern crate graphviz;
extern crate syntax_pos;
extern crate serialize as rustc_serialize; // used by deriving extern crate serialize as rustc_serialize; // used by deriving
// NB: This module needs to be declared first so diagnostics are // NB: This module needs to be declared first so diagnostics are

View file

@ -17,6 +17,7 @@ rustc = { path = "../librustc" }
rustc_back = { path = "../librustc_back" } rustc_back = { path = "../librustc_back" }
rustc_borrowck = { path = "../librustc_borrowck" } rustc_borrowck = { path = "../librustc_borrowck" }
rustc_const_eval = { path = "../librustc_const_eval" } rustc_const_eval = { path = "../librustc_const_eval" }
rustc_errors = { path = "../librustc_errors" }
rustc_lint = { path = "../librustc_lint" } rustc_lint = { path = "../librustc_lint" }
rustc_llvm = { path = "../librustc_llvm" } rustc_llvm = { path = "../librustc_llvm" }
rustc_mir = { path = "../librustc_mir" } rustc_mir = { path = "../librustc_mir" }
@ -32,3 +33,4 @@ rustc_metadata = { path = "../librustc_metadata" }
serialize = { path = "../libserialize" } serialize = { path = "../libserialize" }
syntax = { path = "../libsyntax" } syntax = { path = "../libsyntax" }
syntax_ext = { path = "../libsyntax_ext" } syntax_ext = { path = "../libsyntax_ext" }
syntax_pos = { path = "../libsyntax_pos" }

View file

@ -42,6 +42,7 @@ extern crate rustc;
extern crate rustc_back; extern crate rustc_back;
extern crate rustc_borrowck; extern crate rustc_borrowck;
extern crate rustc_const_eval; extern crate rustc_const_eval;
extern crate rustc_errors as errors;
extern crate rustc_passes; extern crate rustc_passes;
extern crate rustc_lint; extern crate rustc_lint;
extern crate rustc_plugin; extern crate rustc_plugin;
@ -60,6 +61,7 @@ extern crate log;
#[macro_use] #[macro_use]
extern crate syntax; extern crate syntax;
extern crate syntax_ext; extern crate syntax_ext;
extern crate syntax_pos;
use driver::CompileController; use driver::CompileController;
use pretty::{PpMode, UserIdentifiedItem}; use pretty::{PpMode, UserIdentifiedItem};
@ -92,11 +94,12 @@ use std::thread;
use rustc::session::early_error; use rustc::session::early_error;
use syntax::{ast, errors, diagnostics}; use syntax::{ast, json};
use syntax::codemap::{CodeMap, FileLoader, RealFileLoader, MultiSpan}; use syntax::codemap::{CodeMap, FileLoader, RealFileLoader};
use syntax::errors::emitter::Emitter;
use syntax::feature_gate::{GatedCfg, UnstableFeatures}; use syntax::feature_gate::{GatedCfg, UnstableFeatures};
use syntax::parse::{self, PResult, token}; use syntax::parse::{self, PResult, token};
use syntax_pos::MultiSpan;
use errors::emitter::Emitter;
#[cfg(test)] #[cfg(test)]
pub mod test; pub mod test;
@ -290,7 +293,7 @@ pub trait CompilerCalls<'a> {
fn early_callback(&mut self, fn early_callback(&mut self,
_: &getopts::Matches, _: &getopts::Matches,
_: &config::Options, _: &config::Options,
_: &diagnostics::registry::Registry, _: &errors::registry::Registry,
_: ErrorOutputType) _: ErrorOutputType)
-> Compilation { -> Compilation {
Compilation::Continue Compilation::Continue
@ -329,7 +332,7 @@ pub trait CompilerCalls<'a> {
_: &config::Options, _: &config::Options,
_: &Option<PathBuf>, _: &Option<PathBuf>,
_: &Option<PathBuf>, _: &Option<PathBuf>,
_: &diagnostics::registry::Registry) _: &errors::registry::Registry)
-> Option<(Input, Option<PathBuf>)> { -> Option<(Input, Option<PathBuf>)> {
None None
} }
@ -344,7 +347,7 @@ pub trait CompilerCalls<'a> {
pub struct RustcDefaultCalls; pub struct RustcDefaultCalls;
fn handle_explain(code: &str, fn handle_explain(code: &str,
descriptions: &diagnostics::registry::Registry, descriptions: &errors::registry::Registry,
output: ErrorOutputType) { output: ErrorOutputType) {
let normalised = if code.starts_with("E") { let normalised = if code.starts_with("E") {
code.to_string() code.to_string()
@ -374,7 +377,7 @@ fn check_cfg(sopts: &config::Options,
config::ErrorOutputType::HumanReadable(color_config) => { config::ErrorOutputType::HumanReadable(color_config) => {
Box::new(errors::emitter::BasicEmitter::stderr(color_config)) Box::new(errors::emitter::BasicEmitter::stderr(color_config))
} }
config::ErrorOutputType::Json => Box::new(errors::json::JsonEmitter::basic()), config::ErrorOutputType::Json => Box::new(json::JsonEmitter::basic()),
}; };
let mut saw_invalid_predicate = false; let mut saw_invalid_predicate = false;
@ -401,7 +404,7 @@ impl<'a> CompilerCalls<'a> for RustcDefaultCalls {
fn early_callback(&mut self, fn early_callback(&mut self,
matches: &getopts::Matches, matches: &getopts::Matches,
sopts: &config::Options, sopts: &config::Options,
descriptions: &diagnostics::registry::Registry, descriptions: &errors::registry::Registry,
output: ErrorOutputType) output: ErrorOutputType)
-> Compilation { -> Compilation {
if let Some(ref code) = matches.opt_str("explain") { if let Some(ref code) = matches.opt_str("explain") {
@ -418,7 +421,7 @@ impl<'a> CompilerCalls<'a> for RustcDefaultCalls {
sopts: &config::Options, sopts: &config::Options,
odir: &Option<PathBuf>, odir: &Option<PathBuf>,
ofile: &Option<PathBuf>, ofile: &Option<PathBuf>,
descriptions: &diagnostics::registry::Registry) descriptions: &errors::registry::Registry)
-> Option<(Input, Option<PathBuf>)> { -> Option<(Input, Option<PathBuf>)> {
match matches.free.len() { match matches.free.len() {
0 => { 0 => {
@ -1081,8 +1084,8 @@ fn exit_on_err() -> ! {
panic!(); panic!();
} }
pub fn diagnostics_registry() -> diagnostics::registry::Registry { pub fn diagnostics_registry() -> errors::registry::Registry {
use syntax::diagnostics::registry::Registry; use errors::registry::Registry;
let mut all_errors = Vec::new(); let mut all_errors = Vec::new();
all_errors.extend_from_slice(&rustc::DIAGNOSTICS); all_errors.extend_from_slice(&rustc::DIAGNOSTICS);

View file

@ -31,12 +31,12 @@ use rustc_mir::pretty::write_mir_pretty;
use rustc_mir::graphviz::write_mir_graphviz; use rustc_mir::graphviz::write_mir_graphviz;
use syntax::ast::{self, BlockCheckMode}; use syntax::ast::{self, BlockCheckMode};
use syntax::codemap;
use syntax::fold::{self, Folder}; use syntax::fold::{self, Folder};
use syntax::print::{pp, pprust}; use syntax::print::{pp, pprust};
use syntax::print::pprust::PrintState; use syntax::print::pprust::PrintState;
use syntax::ptr::P; use syntax::ptr::P;
use syntax::util::small_vector::SmallVector; use syntax::util::small_vector::SmallVector;
use syntax_pos;
use graphviz as dot; use graphviz as dot;
@ -661,7 +661,7 @@ impl fold::Folder for ReplaceBodyWithLoop {
stmts: vec![], stmts: vec![],
rules: rules, rules: rules,
id: ast::DUMMY_NODE_ID, id: ast::DUMMY_NODE_ID,
span: codemap::DUMMY_SP, span: syntax_pos::DUMMY_SP,
}) })
} }
@ -671,7 +671,7 @@ impl fold::Folder for ReplaceBodyWithLoop {
let loop_expr = P(ast::Expr { let loop_expr = P(ast::Expr {
node: ast::ExprKind::Loop(empty_block, None), node: ast::ExprKind::Loop(empty_block, None),
id: ast::DUMMY_NODE_ID, id: ast::DUMMY_NODE_ID,
span: codemap::DUMMY_SP, span: syntax_pos::DUMMY_SP,
attrs: None, attrs: None,
}); });

View file

@ -31,12 +31,13 @@ use rustc::session::{self, config};
use std::rc::Rc; use std::rc::Rc;
use syntax::ast; use syntax::ast;
use syntax::abi::Abi; use syntax::abi::Abi;
use syntax::codemap::{CodeMap, DUMMY_SP}; use syntax::codemap::CodeMap;
use syntax::errors; use errors;
use syntax::errors::emitter::{CoreEmitter, Emitter}; use errors::emitter::{CoreEmitter, Emitter};
use syntax::errors::{Level, RenderSpan}; use errors::{Level, RenderSpan};
use syntax::parse::token; use syntax::parse::token;
use syntax::feature_gate::UnstableFeatures; use syntax::feature_gate::UnstableFeatures;
use syntax_pos::DUMMY_SP;
use rustc::hir; use rustc::hir;

View file

@ -0,0 +1,15 @@
[package]
authors = ["The Rust Project Developers"]
name = "rustc_errors"
version = "0.0.0"
[lib]
name = "rustc_errors"
path = "lib.rs"
crate-type = ["dylib"]
test = false
[dependencies]
log = { path = "../liblog" }
serialize = { path = "../libserialize" }
syntax_pos = { path = "../libsyntax_pos" }

View file

@ -10,14 +10,14 @@
use self::Destination::*; use self::Destination::*;
use codemap::{self, COMMAND_LINE_SP, DUMMY_SP, Span, MultiSpan}; use syntax_pos::{COMMAND_LINE_SP, DUMMY_SP, Span, MultiSpan, LineInfo};
use diagnostics; use registry;
use errors::check_old_skool; use check_old_skool;
use errors::{Level, RenderSpan, CodeSuggestion, DiagnosticBuilder}; use {Level, RenderSpan, CodeSuggestion, DiagnosticBuilder, CodeMapper};
use errors::RenderSpan::*; use RenderSpan::*;
use errors::Level::*; use Level::*;
use errors::snippet::{RenderedLineKind, SnippetData, Style}; use snippet::{RenderedLineKind, SnippetData, Style};
use std::{cmp, fmt}; use std::{cmp, fmt};
use std::io::prelude::*; use std::io::prelude::*;
@ -151,8 +151,8 @@ impl BasicEmitter {
pub struct EmitterWriter { pub struct EmitterWriter {
dst: Destination, dst: Destination,
registry: Option<diagnostics::registry::Registry>, registry: Option<registry::Registry>,
cm: Rc<codemap::CodeMap>, cm: Rc<CodeMapper>,
/// Is this the first error emitted thus far? If not, we emit a /// Is this the first error emitted thus far? If not, we emit a
/// `\n` before the top-level errors. /// `\n` before the top-level errors.
@ -193,8 +193,8 @@ macro_rules! println_maybe_styled {
impl EmitterWriter { impl EmitterWriter {
pub fn stderr(color_config: ColorConfig, pub fn stderr(color_config: ColorConfig,
registry: Option<diagnostics::registry::Registry>, registry: Option<registry::Registry>,
code_map: Rc<codemap::CodeMap>) code_map: Rc<CodeMapper>)
-> EmitterWriter { -> EmitterWriter {
let old_school = check_old_skool(); let old_school = check_old_skool();
if color_config.use_color() { if color_config.use_color() {
@ -214,8 +214,8 @@ impl EmitterWriter {
} }
pub fn new(dst: Box<Write + Send>, pub fn new(dst: Box<Write + Send>,
registry: Option<diagnostics::registry::Registry>, registry: Option<registry::Registry>,
code_map: Rc<codemap::CodeMap>) code_map: Rc<CodeMapper>)
-> EmitterWriter { -> EmitterWriter {
let old_school = check_old_skool(); let old_school = check_old_skool();
EmitterWriter { dst: Raw(dst), EmitterWriter { dst: Raw(dst),
@ -326,11 +326,13 @@ impl EmitterWriter {
fn highlight_suggestion(&mut self, suggestion: &CodeSuggestion) -> io::Result<()> fn highlight_suggestion(&mut self, suggestion: &CodeSuggestion) -> io::Result<()>
{ {
use std::borrow::Borrow;
let primary_span = suggestion.msp.primary_span().unwrap(); let primary_span = suggestion.msp.primary_span().unwrap();
let lines = self.cm.span_to_lines(primary_span).unwrap(); let lines = self.cm.span_to_lines(primary_span).unwrap();
assert!(!lines.lines.is_empty()); assert!(!lines.lines.is_empty());
let complete = suggestion.splice_lines(&self.cm); let complete = suggestion.splice_lines(self.cm.borrow());
let line_count = cmp::min(lines.lines.len(), MAX_HIGHLIGHT_LINES); let line_count = cmp::min(lines.lines.len(), MAX_HIGHLIGHT_LINES);
let display_lines = &lines.lines[..line_count]; let display_lines = &lines.lines[..line_count];
@ -430,7 +432,7 @@ impl EmitterWriter {
} }
} }
fn line_num_max_digits(line: &codemap::LineInfo) -> usize { fn line_num_max_digits(line: &LineInfo) -> usize {
let mut max_line_num = line.line_index + 1; let mut max_line_num = line.line_index + 1;
let mut digits = 0; let mut digits = 0;
while max_line_num > 0 { while max_line_num > 0 {
@ -623,7 +625,8 @@ impl Write for Destination {
mod test { mod test {
use errors::{Level, CodeSuggestion}; use errors::{Level, CodeSuggestion};
use super::EmitterWriter; use super::EmitterWriter;
use codemap::{mk_sp, CodeMap, Span, MultiSpan, BytePos, NO_EXPANSION}; use codemap::CodeMap;
use syntax_pos::{mk_sp, Span, MultiSpan, BytePos, NO_EXPANSION};
use std::sync::{Arc, Mutex}; use std::sync::{Arc, Mutex};
use std::io::{self, Write}; use std::io::{self, Write};
use std::str::from_utf8; use std::str::from_utf8;

View file

@ -8,24 +8,50 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
pub use errors::emitter::ColorConfig; #![crate_name = "rustc_errors"]
#![unstable(feature = "rustc_private", issue = "27812")]
#![crate_type = "dylib"]
#![crate_type = "rlib"]
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
html_root_url = "https://doc.rust-lang.org/nightly/")]
#![cfg_attr(not(stage0), deny(warnings))]
#![feature(custom_attribute)]
#![allow(unused_attributes)]
#![feature(rustc_private)]
#![feature(staged_api)]
#![feature(question_mark)]
#![feature(range_contains)]
#![feature(libc)]
#![feature(unicode)]
extern crate serialize;
extern crate term;
#[macro_use] extern crate log;
#[macro_use] extern crate libc;
extern crate rustc_unicode;
extern crate serialize as rustc_serialize; // used by deriving
extern crate syntax_pos;
pub use emitter::ColorConfig;
use self::Level::*; use self::Level::*;
use self::RenderSpan::*; use self::RenderSpan::*;
use codemap::{self, CodeMap, MultiSpan, NO_EXPANSION, Span}; use emitter::{Emitter, EmitterWriter};
use diagnostics;
use errors::emitter::{Emitter, EmitterWriter};
use std::cell::{RefCell, Cell}; use std::cell::{RefCell, Cell};
use std::{error, fmt}; use std::{error, fmt};
use std::rc::Rc; use std::rc::Rc;
use std::thread::panicking; use std::thread::panicking;
use term;
pub mod emitter; pub mod emitter;
pub mod json;
pub mod snippet; pub mod snippet;
pub mod registry;
use syntax_pos::{BytePos, Loc, FileLinesResult, FileName, MultiSpan, Span, NO_EXPANSION };
use syntax_pos::{MacroBacktrace};
#[derive(Clone)] #[derive(Clone)]
pub enum RenderSpan { pub enum RenderSpan {
@ -43,8 +69,16 @@ pub enum RenderSpan {
#[derive(Clone)] #[derive(Clone)]
pub struct CodeSuggestion { pub struct CodeSuggestion {
msp: MultiSpan, pub msp: MultiSpan,
substitutes: Vec<String>, pub substitutes: Vec<String>,
}
pub trait CodeMapper {
fn lookup_char_pos(&self, pos: BytePos) -> Loc;
fn span_to_lines(&self, sp: Span) -> FileLinesResult;
fn span_to_string(&self, sp: Span) -> String;
fn span_to_filename(&self, sp: Span) -> FileName;
fn macro_backtrace(&self, span: Span) -> Vec<MacroBacktrace>;
} }
impl RenderSpan { impl RenderSpan {
@ -59,8 +93,8 @@ impl RenderSpan {
impl CodeSuggestion { impl CodeSuggestion {
/// Returns the assembled code suggestion. /// Returns the assembled code suggestion.
pub fn splice_lines(&self, cm: &CodeMap) -> String { pub fn splice_lines(&self, cm: &CodeMapper) -> String {
use codemap::{CharPos, Loc, Pos}; use syntax_pos::{CharPos, Loc, Pos};
fn push_trailing(buf: &mut String, line_opt: Option<&str>, fn push_trailing(buf: &mut String, line_opt: Option<&str>,
lo: &Loc, hi_opt: Option<&Loc>) { lo: &Loc, hi_opt: Option<&Loc>) {
@ -181,20 +215,20 @@ impl error::Error for ExplicitBug {
#[derive(Clone)] #[derive(Clone)]
pub struct DiagnosticBuilder<'a> { pub struct DiagnosticBuilder<'a> {
handler: &'a Handler, handler: &'a Handler,
level: Level, pub level: Level,
message: String, pub message: String,
code: Option<String>, pub code: Option<String>,
span: MultiSpan, pub span: MultiSpan,
children: Vec<SubDiagnostic>, pub children: Vec<SubDiagnostic>,
} }
/// For example a note attached to an error. /// For example a note attached to an error.
#[derive(Clone)] #[derive(Clone)]
struct SubDiagnostic { pub struct SubDiagnostic {
level: Level, pub level: Level,
message: String, pub message: String,
span: MultiSpan, pub span: MultiSpan,
render_span: Option<RenderSpan>, pub render_span: Option<RenderSpan>,
} }
impl<'a> DiagnosticBuilder<'a> { impl<'a> DiagnosticBuilder<'a> {
@ -386,10 +420,10 @@ pub struct Handler {
impl Handler { impl Handler {
pub fn with_tty_emitter(color_config: ColorConfig, pub fn with_tty_emitter(color_config: ColorConfig,
registry: Option<diagnostics::registry::Registry>, registry: Option<registry::Registry>,
can_emit_warnings: bool, can_emit_warnings: bool,
treat_err_as_bug: bool, treat_err_as_bug: bool,
cm: Rc<codemap::CodeMap>) cm: Rc<CodeMapper>)
-> Handler { -> Handler {
let emitter = Box::new(EmitterWriter::stderr(color_config, registry, cm)); let emitter = Box::new(EmitterWriter::stderr(color_config, registry, cm));
Handler::with_emitter(can_emit_warnings, treat_err_as_bug, emitter) Handler::with_emitter(can_emit_warnings, treat_err_as_bug, emitter)
@ -662,7 +696,7 @@ impl fmt::Display for Level {
} }
impl Level { impl Level {
fn color(self) -> term::color::Color { pub fn color(self) -> term::color::Color {
match self { match self {
Bug | Fatal | PhaseFatal | Error => term::color::BRIGHT_RED, Bug | Fatal | PhaseFatal | Error => term::color::BRIGHT_RED,
Warning => term::color::YELLOW, Warning => term::color::YELLOW,
@ -672,7 +706,7 @@ impl Level {
} }
} }
fn to_str(self) -> &'static str { pub fn to_str(self) -> &'static str {
match self { match self {
Bug => "error: internal compiler error", Bug => "error: internal compiler error",
Fatal | PhaseFatal | Error => "error", Fatal | PhaseFatal | Error => "error",

View file

@ -10,8 +10,9 @@
// Code for annotating snippets. // Code for annotating snippets.
use codemap::{CharPos, CodeMap, FileMap, LineInfo, Span}; use syntax_pos::{Span, FileMap, CharPos, LineInfo};
use errors::check_old_skool; use check_old_skool;
use CodeMapper;
use std::cmp; use std::cmp;
use std::rc::Rc; use std::rc::Rc;
use std::mem; use std::mem;
@ -20,7 +21,7 @@ mod test;
#[derive(Clone)] #[derive(Clone)]
pub struct SnippetData { pub struct SnippetData {
codemap: Rc<CodeMap>, codemap: Rc<CodeMapper>,
files: Vec<FileInfo>, files: Vec<FileInfo>,
} }
@ -111,7 +112,7 @@ pub enum RenderedLineKind {
} }
impl SnippetData { impl SnippetData {
pub fn new(codemap: Rc<CodeMap>, pub fn new(codemap: Rc<CodeMapper>,
primary_span: Option<Span>) // (*) primary_span: Option<Span>) // (*)
-> Self { -> Self {
// (*) The primary span indicates the file that must appear // (*) The primary span indicates the file that must appear
@ -454,7 +455,7 @@ impl FileInfo {
return line_index - first_line_index; return line_index - first_line_index;
} }
fn render_file_lines(&self, codemap: &Rc<CodeMap>) -> Vec<RenderedLine> { fn render_file_lines(&self, codemap: &Rc<CodeMapper>) -> Vec<RenderedLine> {
let old_school = check_old_skool(); let old_school = check_old_skool();
// As a first step, we elide any instance of more than one // As a first step, we elide any instance of more than one

View file

@ -12,7 +12,8 @@
#![cfg(test)] #![cfg(test)]
use codemap::{BytePos, CodeMap, FileMap, NO_EXPANSION, Span}; use codemap::{CodeMap};
use syntax_pos::{NO_EXPANSION, Span, FileMap, BytePos};
use std::rc::Rc; use std::rc::Rc;
use super::{RenderedLine, SnippetData}; use super::{RenderedLine, SnippetData};

View file

@ -16,3 +16,4 @@ rustc_data_structures = { path = "../librustc_data_structures" }
serialize = { path = "../libserialize" } serialize = { path = "../libserialize" }
log = { path = "../liblog" } log = { path = "../liblog" }
syntax = { path = "../libsyntax" } syntax = { path = "../libsyntax" }
syntax_pos = { path = "../libsyntax_pos" }

View file

@ -57,8 +57,8 @@ use std::fs::File;
use std::io::Write; use std::io::Write;
use syntax::ast; use syntax::ast;
use syntax::attr::AttrMetaMethods; use syntax::attr::AttrMetaMethods;
use syntax::codemap::Span;
use syntax::parse::token::InternedString; use syntax::parse::token::InternedString;
use syntax_pos::Span;
const IF_THIS_CHANGED: &'static str = "rustc_if_this_changed"; const IF_THIS_CHANGED: &'static str = "rustc_if_this_changed";
const THEN_THIS_WOULD_NEED: &'static str = "rustc_then_this_would_need"; const THEN_THIS_WOULD_NEED: &'static str = "rustc_then_this_would_need";

View file

@ -114,8 +114,8 @@ mod svh_visitor {
pub use self::SawStmtComponent::*; pub use self::SawStmtComponent::*;
use self::SawAbiComponent::*; use self::SawAbiComponent::*;
use syntax::ast::{self, Name, NodeId}; use syntax::ast::{self, Name, NodeId};
use syntax::codemap::Span;
use syntax::parse::token; use syntax::parse::token;
use syntax_pos::Span;
use rustc::ty::TyCtxt; use rustc::ty::TyCtxt;
use rustc::hir; use rustc::hir;
use rustc::hir::*; use rustc::hir::*;

View file

@ -30,6 +30,7 @@ extern crate serialize as rustc_serialize;
#[macro_use] extern crate log; #[macro_use] extern crate log;
#[macro_use] extern crate syntax; #[macro_use] extern crate syntax;
extern crate syntax_pos;
mod assert_dep_graph; mod assert_dep_graph;
mod calculate_svh; mod calculate_svh;

View file

@ -15,7 +15,7 @@ use lint::{LintPass, LateLintPass};
use syntax::ast; use syntax::ast;
use syntax::attr::{self, AttrMetaMethods}; use syntax::attr::{self, AttrMetaMethods};
use syntax::codemap::Span; use syntax_pos::Span;
use rustc::hir::{self, PatKind}; use rustc::hir::{self, PatKind};
use rustc::hir::intravisit::FnKind; use rustc::hir::intravisit::FnKind;

View file

@ -45,7 +45,7 @@ use std::collections::HashSet;
use syntax::{ast}; use syntax::{ast};
use syntax::attr::{self, AttrMetaMethods}; use syntax::attr::{self, AttrMetaMethods};
use syntax::codemap::{self, Span}; use syntax_pos::{self, Span};
use rustc::hir::{self, PatKind}; use rustc::hir::{self, PatKind};
use rustc::hir::intravisit::FnKind; use rustc::hir::intravisit::FnKind;
@ -1140,9 +1140,9 @@ impl LateLintPass for DropWithReprExtern {
if hints.iter().any(|attr| *attr == attr::ReprExtern) && if hints.iter().any(|attr| *attr == attr::ReprExtern) &&
self_type_def.dtor_kind().has_drop_flag() { self_type_def.dtor_kind().has_drop_flag() {
let drop_impl_span = ctx.tcx.map.def_id_span(drop_impl_did, let drop_impl_span = ctx.tcx.map.def_id_span(drop_impl_did,
codemap::DUMMY_SP); syntax_pos::DUMMY_SP);
let self_defn_span = ctx.tcx.map.def_id_span(self_type_did, let self_defn_span = ctx.tcx.map.def_id_span(self_type_did,
codemap::DUMMY_SP); syntax_pos::DUMMY_SP);
ctx.span_lint_note(DROP_WITH_REPR_EXTERN, ctx.span_lint_note(DROP_WITH_REPR_EXTERN,
drop_impl_span, drop_impl_span,
"implementing Drop adds hidden state to types, \ "implementing Drop adds hidden state to types, \

View file

@ -45,6 +45,7 @@ extern crate rustc;
extern crate log; extern crate log;
extern crate rustc_back; extern crate rustc_back;
extern crate rustc_const_eval; extern crate rustc_const_eval;
extern crate syntax_pos;
pub use rustc::lint as lint; pub use rustc::lint as lint;
pub use rustc::middle as middle; pub use rustc::middle as middle;

View file

@ -27,7 +27,8 @@ use std::{i8, i16, i32, i64, u8, u16, u32, u64, f32, f64};
use syntax::ast; use syntax::ast;
use syntax::abi::Abi; use syntax::abi::Abi;
use syntax::attr; use syntax::attr;
use syntax::codemap::{self, Span}; use syntax_pos::Span;
use syntax::codemap;
use rustc::hir; use rustc::hir;

View file

@ -19,9 +19,9 @@ use std::collections::hash_map::Entry::{Occupied, Vacant};
use syntax::ast; use syntax::ast;
use syntax::attr::{self, AttrMetaMethods}; use syntax::attr::{self, AttrMetaMethods};
use syntax::codemap::Span;
use syntax::feature_gate::{KNOWN_ATTRIBUTES, AttributeType}; use syntax::feature_gate::{KNOWN_ATTRIBUTES, AttributeType};
use syntax::ptr::P; use syntax::ptr::P;
use syntax_pos::Span;
use rustc_back::slice; use rustc_back::slice;
use rustc::hir; use rustc::hir;

View file

@ -16,6 +16,8 @@ rustc = { path = "../librustc" }
rustc_back = { path = "../librustc_back" } rustc_back = { path = "../librustc_back" }
rustc_bitflags = { path = "../librustc_bitflags" } rustc_bitflags = { path = "../librustc_bitflags" }
rustc_const_math = { path = "../librustc_const_math" } rustc_const_math = { path = "../librustc_const_math" }
rustc_errors = { path = "../librustc_errors" }
rustc_llvm = { path = "../librustc_llvm" } rustc_llvm = { path = "../librustc_llvm" }
serialize = { path = "../libserialize" } serialize = { path = "../libserialize" }
syntax = { path = "../libsyntax" } syntax = { path = "../libsyntax" }
syntax_pos = { path = "../libsyntax_pos" }

View file

@ -37,9 +37,10 @@ use middle::region;
use rustc::ty::subst; use rustc::ty::subst;
use rustc::ty::{self, Ty, TyCtxt}; use rustc::ty::{self, Ty, TyCtxt};
use syntax::{ast, codemap}; use syntax::ast;
use syntax::ast::NodeIdAssigner; use syntax::ast::NodeIdAssigner;
use syntax::ptr::P; use syntax::ptr::P;
use syntax_pos;
use std::cell::Cell; use std::cell::Cell;
use std::io::SeekFrom; use std::io::SeekFrom;
@ -115,7 +116,7 @@ impl<'a, 'b, 'c, 'tcx> ast_map::FoldOps for &'a DecodeContext<'b, 'c, 'tcx> {
fn new_def_id(&self, def_id: DefId) -> DefId { fn new_def_id(&self, def_id: DefId) -> DefId {
self.tr_def_id(def_id) self.tr_def_id(def_id)
} }
fn new_span(&self, span: codemap::Span) -> codemap::Span { fn new_span(&self, span: syntax_pos::Span) -> syntax_pos::Span {
self.tr_span(span) self.tr_span(span)
} }
} }
@ -206,7 +207,7 @@ impl<'a, 'b, 'tcx> DecodeContext<'a, 'b, 'tcx> {
/// Translates a `Span` from an extern crate to the corresponding `Span` /// Translates a `Span` from an extern crate to the corresponding `Span`
/// within the local crate's codemap. /// within the local crate's codemap.
pub fn tr_span(&self, span: codemap::Span) -> codemap::Span { pub fn tr_span(&self, span: syntax_pos::Span) -> syntax_pos::Span {
decoder::translate_span(self.cdata, decoder::translate_span(self.cdata,
self.tcx.sess.codemap(), self.tcx.sess.codemap(),
&self.last_filemap_index, &self.last_filemap_index,
@ -226,8 +227,8 @@ impl tr for Option<DefId> {
} }
} }
impl tr for codemap::Span { impl tr for syntax_pos::Span {
fn tr(&self, dcx: &DecodeContext) -> codemap::Span { fn tr(&self, dcx: &DecodeContext) -> syntax_pos::Span {
dcx.tr_span(*self) dcx.tr_span(*self)
} }
} }
@ -1268,7 +1269,7 @@ fn decode_item_ast(item_doc: rbml::Doc) -> hir::Item {
#[cfg(test)] #[cfg(test)]
trait FakeExtCtxt { trait FakeExtCtxt {
fn call_site(&self) -> codemap::Span; fn call_site(&self) -> syntax_pos::Span;
fn cfg(&self) -> ast::CrateConfig; fn cfg(&self) -> ast::CrateConfig;
fn ident_of(&self, st: &str) -> ast::Ident; fn ident_of(&self, st: &str) -> ast::Ident;
fn name_of(&self, st: &str) -> ast::Name; fn name_of(&self, st: &str) -> ast::Name;
@ -1277,11 +1278,11 @@ trait FakeExtCtxt {
#[cfg(test)] #[cfg(test)]
impl FakeExtCtxt for parse::ParseSess { impl FakeExtCtxt for parse::ParseSess {
fn call_site(&self) -> codemap::Span { fn call_site(&self) -> syntax_pos::Span {
codemap::Span { syntax_pos::Span {
lo: codemap::BytePos(0), lo: syntax_pos::BytePos(0),
hi: codemap::BytePos(0), hi: syntax_pos::BytePos(0),
expn_id: codemap::NO_EXPANSION, expn_id: syntax_pos::NO_EXPANSION,
} }
} }
fn cfg(&self) -> ast::CrateConfig { Vec::new() } fn cfg(&self) -> ast::CrateConfig { Vec::new() }

View file

@ -34,12 +34,13 @@ use std::fs;
use syntax::ast; use syntax::ast;
use syntax::abi::Abi; use syntax::abi::Abi;
use syntax::codemap::{self, Span, mk_sp, Pos}; use syntax::codemap;
use syntax::parse; use syntax::parse;
use syntax::attr; use syntax::attr;
use syntax::attr::AttrMetaMethods; use syntax::attr::AttrMetaMethods;
use syntax::parse::token::InternedString; use syntax::parse::token::InternedString;
use syntax::visit; use syntax::visit;
use syntax_pos::{self, Span, mk_sp, Pos};
use log; use log;
struct LocalCrateReader<'a> { struct LocalCrateReader<'a> {
@ -726,7 +727,7 @@ impl<'a> CrateReader<'a> {
info!("panic runtime not found -- loading {}", name); info!("panic runtime not found -- loading {}", name);
let (cnum, data, _) = self.resolve_crate(&None, name, name, None, let (cnum, data, _) = self.resolve_crate(&None, name, name, None,
codemap::DUMMY_SP, syntax_pos::DUMMY_SP,
PathKind::Crate, false); PathKind::Crate, false);
// Sanity check the loaded crate to ensure it is indeed a panic runtime // Sanity check the loaded crate to ensure it is indeed a panic runtime
@ -807,7 +808,7 @@ impl<'a> CrateReader<'a> {
&self.sess.target.target.options.exe_allocation_crate &self.sess.target.target.options.exe_allocation_crate
}; };
let (cnum, data, _) = self.resolve_crate(&None, name, name, None, let (cnum, data, _) = self.resolve_crate(&None, name, name, None,
codemap::DUMMY_SP, syntax_pos::DUMMY_SP,
PathKind::Crate, false); PathKind::Crate, false);
// Sanity check the crate we loaded to ensure that it is indeed an // Sanity check the crate we loaded to ensure that it is indeed an
@ -1076,7 +1077,7 @@ pub fn import_codemap(local_codemap: &codemap::CodeMap,
None => { None => {
// We can't reuse an existing FileMap, so allocate a new one // We can't reuse an existing FileMap, so allocate a new one
// containing the information we need. // containing the information we need.
let codemap::FileMap { let syntax_pos::FileMap {
name, name,
abs_path, abs_path,
start_pos, start_pos,
@ -1118,8 +1119,8 @@ pub fn import_codemap(local_codemap: &codemap::CodeMap,
return imported_filemaps; return imported_filemaps;
fn are_equal_modulo_startpos(fm1: &codemap::FileMap, fn are_equal_modulo_startpos(fm1: &syntax_pos::FileMap,
fm2: &codemap::FileMap) fm2: &syntax_pos::FileMap)
-> bool { -> bool {
if fm1.name != fm2.name { if fm1.name != fm2.name {
return false; return false;

View file

@ -36,6 +36,7 @@ use syntax::ast;
use syntax::attr; use syntax::attr;
use syntax::codemap; use syntax::codemap;
use syntax::parse::token::IdentInterner; use syntax::parse::token::IdentInterner;
use syntax_pos;
pub use middle::cstore::{NativeLibraryKind, LinkagePreference}; pub use middle::cstore::{NativeLibraryKind, LinkagePreference};
pub use middle::cstore::{NativeStatic, NativeFramework, NativeUnknown}; pub use middle::cstore::{NativeStatic, NativeFramework, NativeUnknown};
@ -52,15 +53,15 @@ pub enum MetadataBlob {
MetadataArchive(loader::ArchiveMetadata), MetadataArchive(loader::ArchiveMetadata),
} }
/// Holds information about a codemap::FileMap imported from another crate. /// Holds information about a syntax_pos::FileMap imported from another crate.
/// See creader::import_codemap() for more information. /// See creader::import_codemap() for more information.
pub struct ImportedFileMap { pub struct ImportedFileMap {
/// This FileMap's byte-offset within the codemap of its original crate /// This FileMap's byte-offset within the codemap of its original crate
pub original_start_pos: codemap::BytePos, pub original_start_pos: syntax_pos::BytePos,
/// The end of this FileMap within the codemap of its original crate /// The end of this FileMap within the codemap of its original crate
pub original_end_pos: codemap::BytePos, pub original_end_pos: syntax_pos::BytePos,
/// The imported FileMap's representation within the local codemap /// The imported FileMap's representation within the local codemap
pub translated_filemap: Rc<codemap::FileMap> pub translated_filemap: Rc<syntax_pos::FileMap>
} }
pub struct crate_metadata { pub struct crate_metadata {

View file

@ -56,10 +56,10 @@ use syntax::attr;
use syntax::parse::token::{self, IdentInterner}; use syntax::parse::token::{self, IdentInterner};
use syntax::ast; use syntax::ast;
use syntax::abi::Abi; use syntax::abi::Abi;
use syntax::codemap::{self, Span, BytePos, NO_EXPANSION}; use syntax::codemap;
use syntax::print::pprust; use syntax::print::pprust;
use syntax::ptr::P; use syntax::ptr::P;
use syntax_pos::{self, Span, BytePos, NO_EXPANSION};
pub type Cmd<'a> = &'a crate_metadata; pub type Cmd<'a> = &'a crate_metadata;
@ -1230,7 +1230,7 @@ fn get_attributes(md: rbml::Doc) -> Vec<ast::Attribute> {
value: meta_item, value: meta_item,
is_sugared_doc: is_sugared_doc, is_sugared_doc: is_sugared_doc,
}, },
span: codemap::DUMMY_SP span: syntax_pos::DUMMY_SP
} }
}).collect() }).collect()
}, },
@ -1380,8 +1380,8 @@ fn reverse_translate_def_id(cdata: Cmd, did: DefId) -> Option<DefId> {
pub fn translate_span(cdata: Cmd, pub fn translate_span(cdata: Cmd,
codemap: &codemap::CodeMap, codemap: &codemap::CodeMap,
last_filemap_index_hint: &Cell<usize>, last_filemap_index_hint: &Cell<usize>,
span: codemap::Span) span: syntax_pos::Span)
-> codemap::Span { -> syntax_pos::Span {
let span = if span.lo > span.hi { let span = if span.lo > span.hi {
// Currently macro expansion sometimes produces invalid Span values // Currently macro expansion sometimes produces invalid Span values
// where lo > hi. In order not to crash the compiler when trying to // where lo > hi. In order not to crash the compiler when trying to
@ -1390,7 +1390,7 @@ pub fn translate_span(cdata: Cmd,
// least some of the time). // least some of the time).
// This workaround is only necessary as long as macro expansion is // This workaround is only necessary as long as macro expansion is
// not fixed. FIXME(#23480) // not fixed. FIXME(#23480)
codemap::mk_sp(span.lo, span.lo) syntax_pos::mk_sp(span.lo, span.lo)
} else { } else {
span span
}; };
@ -1430,7 +1430,7 @@ pub fn translate_span(cdata: Cmd,
let hi = (span.hi - filemap.original_start_pos) + let hi = (span.hi - filemap.original_start_pos) +
filemap.translated_filemap.start_pos; filemap.translated_filemap.start_pos;
codemap::mk_sp(lo, hi) syntax_pos::mk_sp(lo, hi)
} }
pub fn each_inherent_implementation_for_type<F>(cdata: Cmd, pub fn each_inherent_implementation_for_type<F>(cdata: Cmd,
@ -1733,7 +1733,7 @@ pub fn is_default_impl(cdata: Cmd, impl_id: DefIndex) -> bool {
item_family(impl_doc) == Family::DefaultImpl item_family(impl_doc) == Family::DefaultImpl
} }
pub fn get_imported_filemaps(metadata: &[u8]) -> Vec<codemap::FileMap> { pub fn get_imported_filemaps(metadata: &[u8]) -> Vec<syntax_pos::FileMap> {
let crate_doc = rbml::Doc::new(metadata); let crate_doc = rbml::Doc::new(metadata);
let cm_doc = reader::get_doc(crate_doc, tag_codemap); let cm_doc = reader::get_doc(crate_doc, tag_codemap);

View file

@ -44,10 +44,10 @@ use std::rc::Rc;
use std::u32; use std::u32;
use syntax::abi::Abi; use syntax::abi::Abi;
use syntax::ast::{self, NodeId, Name, CRATE_NODE_ID, CrateNum}; use syntax::ast::{self, NodeId, Name, CRATE_NODE_ID, CrateNum};
use syntax::codemap::BytePos;
use syntax::attr; use syntax::attr;
use syntax::errors::Handler; use errors::Handler;
use syntax; use syntax;
use syntax_pos::BytePos;
use rbml::writer::Encoder; use rbml::writer::Encoder;
use rustc::hir::{self, PatKind}; use rustc::hir::{self, PatKind};

View file

@ -28,10 +28,11 @@
#[macro_use] extern crate log; #[macro_use] extern crate log;
#[macro_use] extern crate syntax; #[macro_use] extern crate syntax;
#[macro_use] #[no_link] extern crate rustc_bitflags; #[macro_use] #[no_link] extern crate rustc_bitflags;
extern crate syntax_pos;
extern crate flate; extern crate flate;
extern crate rbml; extern crate rbml;
extern crate serialize as rustc_serialize; // used by deriving extern crate serialize as rustc_serialize; // used by deriving
extern crate rustc_errors as errors;
#[macro_use] #[macro_use]
extern crate rustc; extern crate rustc;

View file

@ -225,8 +225,8 @@ use rustc::util::common;
use rustc_llvm as llvm; use rustc_llvm as llvm;
use rustc_llvm::{False, ObjectFile, mk_section_iter}; use rustc_llvm::{False, ObjectFile, mk_section_iter};
use rustc_llvm::archive_ro::ArchiveRO; use rustc_llvm::archive_ro::ArchiveRO;
use syntax::codemap::Span; use errors::DiagnosticBuilder;
use syntax::errors::DiagnosticBuilder; use syntax_pos::Span;
use rustc_back::target::Target; use rustc_back::target::Target;
use std::cmp; use std::cmp;

View file

@ -16,12 +16,12 @@ use cstore::CStore;
use rustc::session::Session; use rustc::session::Session;
use std::collections::{HashSet, HashMap}; use std::collections::{HashSet, HashMap};
use syntax::codemap::Span;
use syntax::parse::token; use syntax::parse::token;
use syntax::ast; use syntax::ast;
use syntax::attr; use syntax::attr;
use syntax::attr::AttrMetaMethods; use syntax::attr::AttrMetaMethods;
use syntax::ext; use syntax::ext;
use syntax_pos::Span;
pub struct MacroLoader<'a> { pub struct MacroLoader<'a> {
sess: &'a Session, sess: &'a Session,

View file

@ -29,7 +29,7 @@ use rustc::hir;
use syntax::abi::Abi; use syntax::abi::Abi;
use syntax::ast; use syntax::ast;
use syntax::errors::Handler; use errors::Handler;
use rbml::leb128; use rbml::leb128;
use encoder; use encoder;

View file

@ -24,7 +24,7 @@ use rustc::middle::const_val::ConstVal;
use rustc::ty; use rustc::ty;
use rustc::mir::repr::*; use rustc::mir::repr::*;
use syntax::ast; use syntax::ast;
use syntax::codemap::Span; use syntax_pos::Span;
impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> { impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
/// Compile `expr`, yielding an rvalue. /// Compile `expr`, yielding an rvalue.

View file

@ -13,7 +13,7 @@ use build::scope::LoopScope;
use hair::*; use hair::*;
use rustc::middle::region::CodeExtent; use rustc::middle::region::CodeExtent;
use rustc::mir::repr::*; use rustc::mir::repr::*;
use syntax::codemap::Span; use syntax_pos::Span;
impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> { impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {

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