Skip to content
Permalink
Browse files

Move errors from libsyntax to its own crate

  • Loading branch information...
Jonathan Turner
Jonathan Turner committed Jun 21, 2016
1 parent 3908913 commit 6ae350213485f7c917113f3916e58c51cef97a76
Showing with 1,388 additions and 1,175 deletions.
  1. +23 −21 mk/crates.mk
  2. +1 −1 src/doc/book/compiler-plugins.md
  3. +5 −5 src/grammar/verify.rs
  4. +2 −0 src/librustc/Cargo.toml
  5. +2 −1 src/librustc/hir/fold.rs
  6. +2 −1 src/librustc/hir/intravisit.rs
  7. +2 −1 src/librustc/hir/lowering.rs
  8. +1 −1 src/librustc/hir/map/blocks.rs
  9. +1 −1 src/librustc/hir/map/collector.rs
  10. +2 −1 src/librustc/hir/map/mod.rs
  11. +2 −1 src/librustc/hir/mod.rs
  12. +2 −1 src/librustc/hir/pat_util.rs
  13. +11 −10 src/librustc/hir/print.rs
  14. +1 −1 src/librustc/infer/combine.rs
  15. +3 −3 src/librustc/infer/error_reporting.rs
  16. +1 −1 src/librustc/infer/higher_ranked/mod.rs
  17. +5 −6 src/librustc/infer/mod.rs
  18. +1 −1 src/librustc/infer/type_variable.rs
  19. +2 −0 src/librustc/lib.rs
  20. +2 −2 src/librustc/lint/context.rs
  21. +1 −1 src/librustc/lint/mod.rs
  22. +1 −1 src/librustc/middle/astconv_util.rs
  23. +1 −1 src/librustc/middle/cstore.rs
  24. +3 −2 src/librustc/middle/dead.rs
  25. +1 −1 src/librustc/middle/effect.rs
  26. +1 −1 src/librustc/middle/entry.rs
  27. +1 −1 src/librustc/middle/expr_use_visitor.rs
  28. +1 −1 src/librustc/middle/intrinsicck.rs
  29. +2 −1 src/librustc/middle/liveness.rs
  30. +1 −1 src/librustc/middle/mem_categorization.rs
  31. +2 −1 src/librustc/middle/region.rs
  32. +1 −1 src/librustc/middle/resolve_lifetime.rs
  33. +1 −1 src/librustc/middle/stability.rs
  34. +1 −1 src/librustc/middle/weak_lang_items.rs
  35. +1 −1 src/librustc/mir/repr.rs
  36. +1 −1 src/librustc/mir/visit.rs
  37. +2 −1 src/librustc/session/config.rs
  38. +6 −7 src/librustc/session/mod.rs
  39. +1 −1 src/librustc/traits/coherence.rs
  40. +2 −2 src/librustc/traits/error_reporting.rs
  41. +1 −1 src/librustc/traits/mod.rs
  42. +1 −1 src/librustc/traits/specialize/mod.rs
  43. +1 −1 src/librustc/traits/util.rs
  44. +1 −1 src/librustc/ty/adjustment.rs
  45. +3 −3 src/librustc/ty/context.rs
  46. +2 −2 src/librustc/ty/error.rs
  47. +1 −1 src/librustc/ty/layout.rs
  48. +1 −1 src/librustc/ty/mod.rs
  49. +1 −1 src/librustc/ty/subst.rs
  50. +1 −1 src/librustc/ty/util.rs
  51. +1 −1 src/librustc/ty/wf.rs
  52. +1 −0 src/librustc_borrowck/Cargo.toml
  53. +1 −1 src/librustc_borrowck/borrowck/check_loans.rs
  54. +1 −1 src/librustc_borrowck/borrowck/fragments.rs
  55. +1 −1 src/librustc_borrowck/borrowck/gather_loans/gather_moves.rs
  56. +1 −1 src/librustc_borrowck/borrowck/gather_loans/lifetime.rs
  57. +1 −1 src/librustc_borrowck/borrowck/gather_loans/mod.rs
  58. +4 −4 src/librustc_borrowck/borrowck/gather_loans/move_error.rs
  59. +1 −1 src/librustc_borrowck/borrowck/gather_loans/restrictions.rs
  60. +1 −1 src/librustc_borrowck/borrowck/mir/dataflow/sanity_check.rs
  61. +1 −1 src/librustc_borrowck/borrowck/mir/elaborate_drops.rs
  62. +1 −1 src/librustc_borrowck/borrowck/mir/mod.rs
  63. +2 −2 src/librustc_borrowck/borrowck/mod.rs
  64. +1 −1 src/librustc_borrowck/borrowck/move_data.rs
  65. +2 −0 src/librustc_borrowck/lib.rs
  66. +1 −0 src/librustc_const_eval/Cargo.toml
  67. +2 −1 src/librustc_const_eval/check_match.rs
  68. +2 −2 src/librustc_const_eval/eval.rs
  69. +1 −1 src/librustc_const_eval/lib.rs
  70. +2 −0 src/librustc_driver/Cargo.toml
  71. +14 −11 src/librustc_driver/lib.rs
  72. +3 −3 src/librustc_driver/pretty.rs
  73. +5 −4 src/librustc_driver/test.rs
  74. +15 −0 src/librustc_errors/Cargo.toml
  75. +19 −16 src/{libsyntax/errors → librustc_errors}/emitter.rs
  76. +58 −24 src/{libsyntax/errors/mod.rs → librustc_errors/lib.rs}
  77. 0 src/{libsyntax/diagnostics → librustc_errors}/registry.rs
  78. +6 −5 src/{libsyntax/errors → librustc_errors}/snippet/mod.rs
  79. +2 −1 src/{libsyntax/errors → librustc_errors}/snippet/test.rs
  80. +1 −0 src/librustc_incremental/Cargo.toml
  81. +1 −1 src/librustc_incremental/assert_dep_graph.rs
  82. +1 −1 src/librustc_incremental/calculate_svh.rs
  83. +1 −0 src/librustc_incremental/lib.rs
  84. +1 −1 src/librustc_lint/bad_style.rs
  85. +3 −3 src/librustc_lint/builtin.rs
  86. +1 −0 src/librustc_lint/lib.rs
  87. +2 −1 src/librustc_lint/types.rs
  88. +1 −1 src/librustc_lint/unused.rs
  89. +2 −0 src/librustc_metadata/Cargo.toml
  90. +12 −11 src/librustc_metadata/astencode.rs
  91. +7 −6 src/librustc_metadata/creader.rs
  92. +5 −4 src/librustc_metadata/cstore.rs
  93. +8 −8 src/librustc_metadata/decoder.rs
  94. +2 −2 src/librustc_metadata/encoder.rs
  95. +2 −1 src/librustc_metadata/lib.rs
  96. +2 −2 src/librustc_metadata/loader.rs
  97. +1 −1 src/librustc_metadata/macro_import.rs
  98. +1 −1 src/librustc_metadata/tyencode.rs
  99. +1 −1 src/librustc_mir/build/expr/as_rvalue.rs
  100. +1 −1 src/librustc_mir/build/expr/stmt.rs
  101. +1 −1 src/librustc_mir/build/matches/mod.rs
  102. +1 −1 src/librustc_mir/build/matches/test.rs
  103. +1 −1 src/librustc_mir/build/misc.rs
  104. +1 −1 src/librustc_mir/build/mod.rs
  105. +1 −1 src/librustc_mir/build/scope.rs
  106. +1 −1 src/librustc_mir/hair/cx/pattern.rs
  107. +1 −1 src/librustc_mir/hair/mod.rs
  108. +1 −0 src/librustc_mir/lib.rs
  109. +1 −1 src/librustc_mir/mir_map.rs
  110. +1 −1 src/librustc_mir/transform/promote_consts.rs
  111. +1 −1 src/librustc_mir/transform/qualify_consts.rs
  112. +1 −1 src/librustc_mir/transform/type_check.rs
  113. +2 −0 src/librustc_passes/Cargo.toml
  114. +2 −2 src/librustc_passes/ast_validation.rs
  115. +1 −1 src/librustc_passes/consts.rs
  116. +2 −0 src/librustc_passes/lib.rs
  117. +1 −1 src/librustc_passes/loops.rs
  118. +1 −1 src/librustc_passes/rvalues.rs
  119. +1 −1 src/librustc_passes/static_recursion.rs
  120. +1 −0 src/librustc_plugin/Cargo.toml
  121. +2 −2 src/librustc_plugin/build.rs
  122. +2 −0 src/librustc_plugin/lib.rs
  123. +1 −1 src/librustc_plugin/load.rs
  124. +1 −1 src/librustc_plugin/registry.rs
  125. +2 −1 src/librustc_privacy/lib.rs
  126. +2 −0 src/librustc_resolve/Cargo.toml
  127. +2 −1 src/librustc_resolve/build_reduced_graph.rs
  128. +1 −1 src/librustc_resolve/check_unused.rs
  129. +10 −7 src/librustc_resolve/lib.rs
  130. +1 −1 src/librustc_resolve/resolve_imports.rs
  131. +1 −0 src/librustc_save_analysis/Cargo.toml
  132. +1 −1 src/librustc_save_analysis/data.rs
  133. +2 −1 src/librustc_save_analysis/dump_visitor.rs
  134. +2 −1 src/librustc_save_analysis/external_data.rs
  135. +3 −1 src/librustc_save_analysis/lib.rs
  136. +1 −1 src/librustc_save_analysis/span_utils.rs
  137. +2 −0 src/librustc_trans/Cargo.toml
  138. +1 −1 src/librustc_trans/_match.rs
  139. +1 −1 src/librustc_trans/back/link.rs
  140. +4 −4 src/librustc_trans/back/write.rs
  141. +1 −1 src/librustc_trans/base.rs
  142. +1 −1 src/librustc_trans/build.rs
  143. +1 −1 src/librustc_trans/builder.rs
  144. +2 −2 src/librustc_trans/callee.rs
  145. +2 −2 src/librustc_trans/collector.rs
  146. +1 −1 src/librustc_trans/common.rs
  147. +1 −1 src/librustc_trans/consts.rs
  148. +1 −1 src/librustc_trans/datum.rs
  149. +1 −1 src/librustc_trans/debuginfo/create_scope_map.rs
  150. +6 −6 src/librustc_trans/debuginfo/metadata.rs
  151. +9 −9 src/librustc_trans/debuginfo/mod.rs
  152. +1 −1 src/librustc_trans/debuginfo/namespace.rs
  153. +3 −3 src/librustc_trans/debuginfo/source_loc.rs
  154. +5 −5 src/librustc_trans/debuginfo/utils.rs
  155. +4 −3 src/librustc_trans/expr.rs
  156. +1 −1 src/librustc_trans/glue.rs
  157. +1 −1 src/librustc_trans/intrinsic.rs
  158. +2 −0 src/librustc_trans/lib.rs
  159. +1 −1 src/librustc_trans/meth.rs
  160. +1 −1 src/librustc_trans/mir/constant.rs
  161. +1 −1 src/librustc_trans/mir/mod.rs
  162. +1 −1 src/librustc_trans/mir/rvalue.rs
  163. +1 −1 src/librustc_trans/monomorphize.rs
  164. +2 −2 src/librustc_typeck/astconv.rs
  165. +2 −1 src/librustc_typeck/check/_match.rs
  166. +1 −1 src/librustc_typeck/check/assoc.rs
  167. +1 −1 src/librustc_typeck/check/autoderef.rs
  168. +1 −1 src/librustc_typeck/check/callee.rs
  169. +1 −1 src/librustc_typeck/check/cast.rs
  170. +1 −1 src/librustc_typeck/check/compare_method.rs
  171. +1 −1 src/librustc_typeck/check/demand.rs
  172. +4 −4 src/librustc_typeck/check/dropck.rs
  173. +1 −1 src/librustc_typeck/check/intrinsic.rs
  174. +1 −1 src/librustc_typeck/check/method/confirm.rs
  175. +1 −1 src/librustc_typeck/check/method/mod.rs
  176. +1 −1 src/librustc_typeck/check/method/probe.rs
  177. +3 −3 src/librustc_typeck/check/method/suggest.rs
  178. +15 −14 src/librustc_typeck/check/mod.rs
  179. +1 −1 src/librustc_typeck/check/regionck.rs
  180. +1 −1 src/librustc_typeck/check/upvar.rs
  181. +3 −2 src/librustc_typeck/check/wfcheck.rs
  182. +2 −1 src/librustc_typeck/check/writeback.rs
  183. +1 −1 src/librustc_typeck/check_unused.rs
  184. +1 −1 src/librustc_typeck/coherence/mod.rs
  185. +1 −1 src/librustc_typeck/coherence/orphan.rs
  186. +2 −1 src/librustc_typeck/collect.rs
  187. +3 −1 src/librustc_typeck/lib.rs
  188. +1 −1 src/librustc_typeck/rscope.rs
  189. +2 −0 src/librustdoc/Cargo.toml
  190. +5 −5 src/librustdoc/clean/mod.rs
  191. +3 −2 src/librustdoc/core.rs
  192. +4 −3 src/librustdoc/doctree.rs
  193. +2 −1 src/librustdoc/html/highlight.rs
  194. +2 −0 src/librustdoc/lib.rs
  195. +2 −2 src/librustdoc/test.rs
  196. +1 −1 src/librustdoc/visit_ast.rs
  197. +1 −0 src/libsyntax/Cargo.toml
  198. +2 −1 src/libsyntax/ast.rs
  199. +2 −2 src/libsyntax/attr.rs
  200. +37 −655 src/libsyntax/codemap.rs
  201. +2 −1 src/libsyntax/config.rs
  202. +1 −1 src/libsyntax/diagnostics/metadata.rs
  203. +1 −1 src/libsyntax/diagnostics/plugin.rs
  204. +2 −2 src/libsyntax/ext/base.rs
  205. +2 −1 src/libsyntax/ext/build.rs
  206. +4 −4 src/libsyntax/ext/expand.rs
  207. +3 −2 src/libsyntax/ext/quote.rs
  208. +2 −3 src/libsyntax/ext/source_util.rs
  209. +6 −6 src/libsyntax/ext/tt/macro_parser.rs
  210. +1 −1 src/libsyntax/ext/tt/macro_rules.rs
  211. +1 −1 src/libsyntax/ext/tt/transcribe.rs
  212. +3 −3 src/libsyntax/feature_gate.rs
  213. +2 −1 src/libsyntax/fold.rs
  214. +9 −7 src/libsyntax/{errors → }/json.rs
  215. +4 −4 src/libsyntax/lib.rs
  216. +2 −1 src/libsyntax/parse/attr.rs
  217. +2 −1 src/libsyntax/parse/lexer/comments.rs
  218. +24 −23 src/libsyntax/parse/lexer/mod.rs
  219. +1 −1 src/libsyntax/parse/lexer/unicode_chars.rs
  220. +6 −5 src/libsyntax/parse/mod.rs
  221. +1 −1 src/libsyntax/parse/obsolete.rs
  222. +13 −12 src/libsyntax/parse/parser.rs
  223. +12 −11 src/libsyntax/print/pprust.rs
  224. +2 −2 src/libsyntax/std_inject.rs
  225. +2 −2 src/libsyntax/test.rs
  226. +1 −1 src/libsyntax/util/node_count.rs
  227. +2 −1 src/libsyntax/visit.rs
  228. +2 −0 src/libsyntax_ext/Cargo.toml
  229. +1 −1 src/libsyntax_ext/asm.rs
  230. +1 −1 src/libsyntax_ext/cfg.rs
  231. +2 −2 src/libsyntax_ext/concat.rs
  232. +1 −1 src/libsyntax_ext/concat_idents.rs
  233. +1 −1 src/libsyntax_ext/deriving/bounds.rs
  234. +1 −1 src/libsyntax_ext/deriving/clone.rs
  235. +1 −1 src/libsyntax_ext/deriving/cmp/eq.rs
  236. +1 −1 src/libsyntax_ext/deriving/cmp/ord.rs
  237. +1 −1 src/libsyntax_ext/deriving/cmp/partial_eq.rs
  238. +1 −1 src/libsyntax_ext/deriving/cmp/partial_ord.rs
  239. +2 −1 src/libsyntax_ext/deriving/debug.rs
  240. +1 −1 src/libsyntax_ext/deriving/decodable.rs
  241. +1 −1 src/libsyntax_ext/deriving/default.rs
  242. +1 −1 src/libsyntax_ext/deriving/encodable.rs
  243. +3 −3 src/libsyntax_ext/deriving/generic/mod.rs
  244. +2 −1 src/libsyntax_ext/deriving/generic/ty.rs
  245. +1 −1 src/libsyntax_ext/deriving/hash.rs
  246. +2 −1 src/libsyntax_ext/deriving/mod.rs
  247. +1 −1 src/libsyntax_ext/env.rs
  248. +2 −1 src/libsyntax_ext/format.rs
  249. +2 −0 src/libsyntax_ext/lib.rs
  250. +2 −2 src/libsyntax_ext/log_syntax.rs
  251. +1 −2 src/libsyntax_ext/trace_macros.rs
  252. +13 −0 src/libsyntax_pos/Cargo.toml
  253. +667 −0 src/libsyntax_pos/lib.rs
  254. +1 −1 src/test/compile-fail-fulldeps/auxiliary/macro_crate_test.rs
  255. +1 −1 src/test/compile-fail-fulldeps/gated-quote.rs
  256. +1 −1 src/test/compile-fail-fulldeps/qquote.rs
  257. +2 −1 src/test/run-fail-fulldeps/qquote.rs
  258. +1 −1 src/test/run-pass-fulldeps/auxiliary/custom_derive_plugin.rs
  259. +1 −1 src/test/run-pass-fulldeps/auxiliary/custom_derive_plugin_attr.rs
  260. +1 −1 src/test/run-pass-fulldeps/auxiliary/macro_crate_test.rs
  261. +1 −1 src/test/run-pass-fulldeps/auxiliary/plugin_args.rs
  262. +1 −1 src/test/run-pass-fulldeps/auxiliary/procedural_mbe_matching.rs
  263. +1 −1 src/test/run-pass-fulldeps/auxiliary/roman_numerals.rs
  264. +1 −1 src/test/run-pass-fulldeps/auxiliary/syntax_extension_with_dll_deps_2.rs
  265. +1 −1 src/test/run-pass-fulldeps/qquote.rs
  266. +1 −1 src/tools/compiletest/src/json.rs
@@ -57,10 +57,10 @@ TARGET_CRATES := libc std term \
panic_abort panic_unwind unwind
RUSTC_CRATES := rustc rustc_typeck rustc_mir rustc_borrowck rustc_resolve rustc_driver \
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_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
TOOLS := compiletest rustdoc rustc rustbook error_index_generator

@@ -98,43 +98,45 @@ DEPS_serialize := std log
DEPS_term := std
DEPS_test := std getopts term native:rust_test_helpers

DEPS_syntax := std term serialize log arena libc rustc_bitflags rustc_unicode
DEPS_syntax_ext := syntax fmt_macros
DEPS_syntax := std term serialize log arena libc rustc_bitflags rustc_unicode rustc_errors syntax_pos
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_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 \
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_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_driver := arena flate getopts graphviz libc rustc rustc_back rustc_borrowck \
rustc_typeck rustc_mir rustc_resolve log syntax serialize rustc_llvm \
rustc_trans rustc_privacy rustc_lint rustc_plugin \
rustc_metadata syntax_ext rustc_passes rustc_save_analysis rustc_const_eval \
rustc_incremental
DEPS_rustc_lint := rustc log syntax rustc_const_eval
rustc_incremental syntax_pos rustc_errors
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_metadata := rustc syntax rbml rustc_const_math
DEPS_rustc_passes := syntax rustc core rustc_const_eval
DEPS_rustc_mir := rustc syntax rustc_const_math rustc_const_eval rustc_bitflags
DEPS_rustc_resolve := arena rustc log syntax
DEPS_rustc_metadata := rustc syntax syntax_pos rustc_errors rbml rustc_const_math
DEPS_rustc_passes := syntax syntax_pos rustc core rustc_const_eval rustc_errors
DEPS_rustc_mir := rustc syntax syntax_pos rustc_const_math rustc_const_eval rustc_bitflags
DEPS_rustc_resolve := arena rustc log syntax syntax_pos rustc_errors
DEPS_rustc_platform_intrinsics := std
DEPS_rustc_plugin := rustc rustc_metadata syntax
DEPS_rustc_privacy := rustc log syntax
DEPS_rustc_plugin := rustc rustc_metadata syntax syntax_pos rustc_errors
DEPS_rustc_privacy := rustc log syntax syntax_pos
DEPS_rustc_trans := arena flate getopts graphviz libc rustc rustc_back \
log syntax serialize rustc_llvm rustc_platform_intrinsics \
rustc_const_math rustc_const_eval rustc_incremental
DEPS_rustc_incremental := rbml rustc serialize rustc_data_structures
DEPS_rustc_save_analysis := rustc log syntax serialize
DEPS_rustc_typeck := rustc syntax rustc_platform_intrinsics rustc_const_math \
rustc_const_eval
rustc_const_math rustc_const_eval rustc_incremental rustc_errors syntax_pos
DEPS_rustc_incremental := rbml rustc syntax_pos serialize rustc_data_structures
DEPS_rustc_save_analysis := rustc log syntax syntax_pos serialize
DEPS_rustc_typeck := rustc syntax syntax_pos rustc_platform_intrinsics rustc_const_math \
rustc_const_eval rustc_errors

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
@@ -45,11 +45,11 @@ extern crate syntax;
extern crate rustc;
extern crate rustc_plugin;
use syntax::codemap::Span;
use syntax::parse::token;
use syntax::ast::TokenTree;
use syntax::ext::base::{ExtCtxt, MacResult, DummyResult, MacEager};
use syntax::ext::build::AstBuilder; // trait for expr_usize
use syntax_pos::Span;
use rustc_plugin::Registry;
fn expand_rn(cx: &mut ExtCtxt, sp: Span, args: &[TokenTree])
@@ -32,9 +32,9 @@ use std::rc::Rc;
use syntax::ast;
use syntax::ast::Name;
use syntax::codemap;
use syntax::codemap::Pos;
use syntax::parse::token::{self, BinOpToken, DelimToken, Lit, Token};
use syntax::parse::lexer::TokenAndSpan;
use syntax_pos::Pos;

fn parse_token_list(file: &str) -> HashMap<String, 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;
hi -= surrogate_pairs_pos.binary_search(&(hi as usize)).unwrap_or_else(|x| x) as u32;

let sp = codemap::Span {
lo: codemap::BytePos(lo),
hi: codemap::BytePos(hi),
expn_id: codemap::NO_EXPANSION
let sp = syntax_pos::Span {
lo: syntax_pos::BytePos(lo),
hi: syntax_pos::BytePos(hi),
expn_id: syntax_pos::NO_EXPANSION
};

TokenAndSpan {
@@ -19,6 +19,8 @@ rustc_back = { path = "../librustc_back" }
rustc_bitflags = { path = "../librustc_bitflags" }
rustc_const_math = { path = "../librustc_const_math" }
rustc_data_structures = { path = "../librustc_data_structures" }
rustc_errors = { path = "../librustc_errors" }
rustc_llvm = { path = "../librustc_llvm" }
serialize = { path = "../libserialize" }
syntax = { path = "../libsyntax" }
syntax_pos = { path "../libsyntax_pos" }
@@ -16,7 +16,8 @@ use syntax::ast::{Name, NodeId, DUMMY_NODE_ID, Attribute, Attribute_, MetaItem};
use syntax::ast::MetaItemKind;
use syntax::attr::ThinAttributesExt;
use hir;
use syntax::codemap::{respan, Span, Spanned};
use syntax_pos::Span;
use syntax::codemap::{respan, Spanned};
use syntax::ptr::P;
use syntax::parse::token::keywords;
use syntax::util::move_map::MoveMap;
@@ -28,7 +28,8 @@
use syntax::abi::Abi;
use syntax::ast::{NodeId, CRATE_NODE_ID, Name, Attribute};
use syntax::attr::ThinAttributesExt;
use syntax::codemap::{Span, Spanned};
use syntax::codemap::Spanned;
use syntax_pos::Span;
use hir::*;

use std::cmp;
@@ -52,10 +52,11 @@ use std::iter;
use syntax::ast::*;
use syntax::attr::{ThinAttributes, ThinAttributesExt};
use syntax::ptr::P;
use syntax::codemap::{respan, Spanned, Span};
use syntax::codemap::{respan, Spanned};
use syntax::parse::token;
use syntax::std_inject;
use syntax::visit::{self, Visitor};
use syntax_pos::Span;

pub struct LoweringContext<'a> {
crate_root: Option<&'static str>,
@@ -29,7 +29,7 @@ use hir::{Block, FnDecl};
use syntax::ast::{Attribute, Name, NodeId};
use syntax::attr::ThinAttributesExt;
use hir as ast;
use syntax::codemap::Span;
use syntax_pos::Span;
use hir::intravisit::FnKind;

/// An FnLikeNode is a Node that is like a fn, in that it has a decl
@@ -17,7 +17,7 @@ use hir::def_id::DefId;
use middle::cstore::InlinedItem;
use std::iter::repeat;
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
pub struct NodeCollector<'ast> {
@@ -24,8 +24,9 @@ use hir::def_id::{CRATE_DEF_INDEX, DefId, DefIndex};
use syntax::abi::Abi;
use syntax::ast::{self, Name, NodeId, DUMMY_NODE_ID, };
use syntax::attr::ThinAttributesExt;
use syntax::codemap::{Span, Spanned};
use syntax::codemap::Spanned;
use syntax::visit;
use syntax_pos::Span;

use hir::*;
use hir::fold::Folder;
@@ -36,7 +36,8 @@ use hir::def::Def;
use hir::def_id::DefId;
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::ast::{Name, NodeId, DUMMY_NODE_ID, TokenTree, AsmDialect};
use syntax::ast::{Attribute, Lit, StrStyle, FloatTy, IntTy, UintTy, MetaItem};
@@ -14,7 +14,8 @@ use hir::{self, PatKind};
use ty::TyCtxt;
use util::nodemap::FnvHashMap;
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};

@@ -12,15 +12,16 @@ pub use self::AnnNode::*;

use syntax::abi::Abi;
use syntax::ast;
use syntax::codemap::{self, CodeMap, BytePos, Spanned};
use syntax::errors;
use syntax::codemap::{CodeMap, Spanned};
use syntax::parse::token::{self, keywords, BinOpToken};
use syntax::parse::lexer::comments;
use syntax::print::pp::{self, break_offset, word, space, hardbreak};
use syntax::print::pp::{Breaks, eof};
use syntax::print::pp::Breaks::{Consistent, Inconsistent};
use syntax::print::pprust::{self as ast_pp, PrintState};
use syntax::ptr::P;
use syntax_pos::{self, BytePos};
use errors;

use hir;
use hir::{Crate, PatKind, RegionTyParamBound, SelfKind, TraitTyParamBound, TraitBoundModifier};
@@ -368,11 +369,11 @@ impl<'a> State<'a> {
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)
}
pub fn bclose_maybe_open(&mut self,
span: codemap::Span,
span: syntax_pos::Span,
indented: usize,
close_box: bool)
-> io::Result<()> {
@@ -384,7 +385,7 @@ impl<'a> State<'a> {
}
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)
}

@@ -432,7 +433,7 @@ impl<'a> State<'a> {
mut get_span: G)
-> 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)?;
let len = elts.len();
@@ -859,7 +860,7 @@ impl<'a> State<'a> {
enum_definition: &hir::EnumDef,
generics: &hir::Generics,
name: ast::Name,
span: codemap::Span,
span: syntax_pos::Span,
visibility: &hir::Visibility)
-> io::Result<()> {
self.head(&visibility_qualified(visibility, "enum"))?;
@@ -872,7 +873,7 @@ impl<'a> State<'a> {

pub fn print_variants(&mut self,
variants: &[hir::Variant],
span: codemap::Span)
span: syntax_pos::Span)
-> io::Result<()> {
self.bopen()?;
for v in variants {
@@ -902,7 +903,7 @@ impl<'a> State<'a> {
struct_def: &hir::VariantData,
generics: &hir::Generics,
name: ast::Name,
span: codemap::Span,
span: syntax_pos::Span,
print_finalizer: bool)
-> io::Result<()> {
self.print_name(name)?;
@@ -2237,7 +2238,7 @@ impl<'a> State<'a> {
}

pub fn maybe_print_trailing_comment(&mut self,
span: codemap::Span,
span: syntax_pos::Span,
next_pos: Option<BytePos>)
-> io::Result<()> {
let cm = match self.cm {
@@ -49,7 +49,7 @@ use ty::relate::{RelateResult, TypeRelation};
use traits::PredicateObligations;

use syntax::ast;
use syntax::codemap::Span;
use syntax_pos::Span;

#[derive(Clone)]
pub struct CombineFields<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {
@@ -91,10 +91,10 @@ use std::cell::{Cell, RefCell};
use std::char::from_u32;
use std::fmt;
use syntax::ast;
use syntax::errors::{DiagnosticBuilder, check_old_skool};
use syntax::codemap::{self, Pos, Span};
use syntax::parse::token;
use syntax::ptr::P;
use syntax_pos::{self, Pos, Span};
use errors::{DiagnosticBuilder, check_old_skool};

impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
pub fn note_and_explain_region(self,
@@ -1933,6 +1933,6 @@ impl LifeGiver {

fn name_to_dummy_lifetime(name: ast::Name) -> hir::Lifetime {
hir::Lifetime { id: ast::DUMMY_NODE_ID,
span: codemap::DUMMY_SP,
span: syntax_pos::DUMMY_SP,
name: name }
}
@@ -23,7 +23,7 @@ use super::region_inference::{TaintDirections};
use ty::{self, TyCtxt, Binder, TypeFoldable};
use ty::error::TypeError;
use ty::relate::{Relate, RelateResult, TypeRelation};
use syntax::codemap::Span;
use syntax_pos::Span;
use util::nodemap::{FnvHashMap, FnvHashSet};

pub struct HrMatchResult<U> {
@@ -39,9 +39,8 @@ use rustc_data_structures::unify::{self, UnificationTable};
use std::cell::{Cell, RefCell, Ref, RefMut};
use std::fmt;
use syntax::ast;
use syntax::codemap;
use syntax::codemap::{Span, DUMMY_SP};
use syntax::errors::DiagnosticBuilder;
use errors::DiagnosticBuilder;
use syntax_pos::{self, Span, DUMMY_SP};
use util::nodemap::{FnvHashMap, FnvHashSet, NodeMap};

use self::combine::CombineFields;
@@ -1036,7 +1035,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
-> UnitResult<'tcx>
{
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);
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> {
TypeTrace {
origin: TypeOrigin::Misc(codemap::DUMMY_SP),
origin: TypeOrigin::Misc(syntax_pos::DUMMY_SP),
values: Types(ExpectedFound {
expected: tcx.types.err,
found: tcx.types.err,
@@ -1887,7 +1886,7 @@ impl RegionVariableOrigin {
Coercion(a) => a,
EarlyBoundRegion(a, _) => a,
LateBoundRegion(a, _, _) => a,
BoundRegionInCoherence(_) => codemap::DUMMY_SP,
BoundRegionInCoherence(_) => syntax_pos::DUMMY_SP,
UpvarRegion(_, a) => a
}
}
@@ -13,7 +13,7 @@ use self::TypeVariableValue::*;
use self::UndoEntry::*;
use hir::def_id::{DefId};
use ty::{self, Ty};
use syntax::codemap::Span;
use syntax_pos::Span;

use std::cmp::min;
use std::marker::PhantomData;
@@ -55,8 +55,10 @@ extern crate rustc_data_structures;
extern crate serialize;
extern crate collections;
extern crate rustc_const_math;
extern crate rustc_errors as errors;
#[macro_use] extern crate log;
#[macro_use] extern crate syntax;
#[macro_use] extern crate syntax_pos;
#[macro_use] #[no_link] extern crate rustc_bitflags;

extern crate serialize as rustc_serialize; // used by deriving

0 comments on commit 6ae3502

Please sign in to comment.
You can’t perform that action at this time.