Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Batch up libsyntax breaking changes #34424

Merged
merged 44 commits into from
Jun 28, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
dc3d878
Add support for macro expansion inside trait items
Jun 11, 2016
01a0877
Remove inherent method `attrs()` on AST nodes. `attrs()` is now a met…
jseyfried May 24, 2016
febe6a4
Refactor away field `ctxt` of `ast::Mac_`
jseyfried May 24, 2016
5bf7970
Change `fold_tt` and `fold_tts` to take token trees by value (instead…
jseyfried Jun 3, 2016
683e480
Refactor away `WithAttrs` trait
jseyfried Jun 10, 2016
0644aba
Remove the type parameter from `syntax::visit::Visitor`
jseyfried Jun 12, 2016
b5dbe01
Refactor away `ast::Decl` and refactor `ast::Stmt`
jseyfried Jun 17, 2016
962d5c1
Fix fallout
jseyfried Jun 17, 2016
f0b21c2
Rename `ast::ExprKind::Again` -> `ast::ExprKind::Continue`
jseyfried Jun 17, 2016
5033eca
Generalize and abstract `ThinAttributes`
jseyfried Jun 18, 2016
f903c97
Merge PatKind::QPath into PatKind::Path in AST
petrochenkov Jun 11, 2016
d59accf
Refactored tokentrees into their own files in preparation for tokenst…
Jun 20, 2016
f6fe5b6
Cleanup comments
jseyfried Jun 23, 2016
6ae3502
Move errors from libsyntax to its own crate
Jun 21, 2016
2829fbc
Address comments and fix travis warning
Jun 21, 2016
51deb4f
Address more travis errors
Jun 22, 2016
f2fe204
Consolidate codemap tests and fix more errors for travis
Jun 22, 2016
bad4869
Fix touchy test to work with old and new error format
Jun 22, 2016
b68e079
Actually consolidate the CodeMap tests
Jun 23, 2016
2b8bab0
Move test helper functions to consolidated codemap testing
Jun 23, 2016
d4e79de
Add missing refernce to RenderedLine
Jun 23, 2016
b7da35a
Remove field `expr` of `ast::Block`
jseyfried Jun 23, 2016
a48a4f5
Avoid wasting node ids
jseyfried Jun 23, 2016
94479ad
Add regression test
jseyfried Jun 23, 2016
80f1c78
make old school mode a bit more configurable
Jun 23, 2016
bdd3f8f
Updating test I missed for old school refactor
Jun 23, 2016
ea7ba12
Add missing 'extern crate' for test
Jun 23, 2016
060a84d
Refactor away duplicate method `ecx.block_all()`
jseyfried Jun 23, 2016
f960f9e
Fix up rpass tests missing imports
Jun 24, 2016
89da728
Fix rfail test missing import
Jun 24, 2016
8cad251
Add `ecx.stmt_semi()` and fix issues with the pretty-printer
jseyfried Jun 24, 2016
f5259ab
Reexport syntax_pos in codemap and fix some cfail tests
Jun 24, 2016
9f2a507
Fix codemap tests to not double import
Jun 24, 2016
bc14006
reexport errors from syntax. fix failing cfail test
Jun 24, 2016
f0310e0
Rollup merge of #34213 - josephDunne:trait_item_macros, r=jseyfried
jseyfried Jun 25, 2016
4e2e31c
Rollup merge of #34368 - petrochenkov:astqpath, r=Manishearth
jseyfried Jun 25, 2016
d3ae56d
Rollup merge of #34403 - jonathandturner:move_liberror, r=alexcrichton
jseyfried Jun 25, 2016
82a15a6
Rollup merge of #34385 - cgswords:tstream, r=nrc
jseyfried Jun 25, 2016
33ea1e3
Rollup merge of #33943 - jseyfried:libsyntax_cleanup, r=nrc
jseyfried Jun 26, 2016
8748cd9
Rollup merge of #34316 - jseyfried:refactor_ast_stmt, r=eddyb
jseyfried Jun 26, 2016
8eddf02
Rollup merge of #34339 - jseyfried:thin_vec, r=petrochenkov,Manishearth
jseyfried Jun 26, 2016
9bb3ea0
Rollup merge of #34436 - jseyfried:no_block_expr, r=eddyb
jseyfried Jun 26, 2016
542ba8c
Fix `Cargo.toml`s
jseyfried Jun 27, 2016
360dcae
Update `src/rustc/Cargo.lock`
jseyfried Jun 27, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 23 additions & 21 deletions mk/crates.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/doc/book/compiler-plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
10 changes: 5 additions & 5 deletions src/grammar/verify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 2 additions & 0 deletions src/librustc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
2 changes: 1 addition & 1 deletion src/librustc/hir/check_attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ impl<'a> CheckAttrVisitor<'a> {
}
}

impl<'a, 'v> Visitor<'v> for CheckAttrVisitor<'a> {
impl<'a> Visitor for CheckAttrVisitor<'a> {
fn visit_item(&mut self, item: &ast::Item) {
let target = Target::from_item(item);
for attr in &item.attrs {
Expand Down
15 changes: 9 additions & 6 deletions src/librustc/hir/fold.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
use hir::*;
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;
Expand Down Expand Up @@ -292,8 +292,11 @@ pub fn noop_fold_view_path<T: Folder>(view_path: P<ViewPath>, fld: &mut T) -> P<
})
}

pub fn fold_attrs<T: Folder>(attrs: HirVec<Attribute>, fld: &mut T) -> HirVec<Attribute> {
attrs.move_flat_map(|x| fld.fold_attribute(x))
pub fn fold_attrs<T, F>(attrs: T, fld: &mut F) -> T
where T: Into<Vec<Attribute>> + From<Vec<Attribute>>,
F: Folder,
{
attrs.into().move_flat_map(|x| fld.fold_attribute(x)).into()
}

pub fn noop_fold_arm<T: Folder>(Arm { attrs, pats, guard, body }: Arm, fld: &mut T) -> Arm {
Expand Down Expand Up @@ -461,7 +464,7 @@ pub fn noop_fold_local<T: Folder>(l: P<Local>, fld: &mut T) -> P<Local> {
pat: fld.fold_pat(pat),
init: init.map(|e| fld.fold_expr(e)),
span: fld.new_span(span),
attrs: attrs.map_thin_attrs(|attrs| fold_attrs(attrs.into(), fld).into()),
attrs: fold_attrs(attrs, fld),
}
})
}
Expand Down Expand Up @@ -1078,7 +1081,7 @@ pub fn noop_fold_expr<T: Folder>(Expr { id, node, span, attrs }: Expr, folder: &
}
},
span: folder.new_span(span),
attrs: attrs.map_thin_attrs(|attrs| fold_attrs(attrs.into(), folder).into()),
attrs: fold_attrs(attrs, folder),
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/librustc/hir/intravisit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,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;
Expand Down Expand Up @@ -756,7 +756,7 @@ pub fn walk_expr<'v, V: Visitor<'v>>(visitor: &mut V, expression: &'v Expr) {
walk_list!(visitor, visit_arm, arms);
}
ExprClosure(_, ref function_declaration, ref body, _fn_decl_span) => {
visitor.visit_fn(FnKind::Closure(expression.attrs.as_attr_slice()),
visitor.visit_fn(FnKind::Closure(&expression.attrs),
function_declaration,
body,
expression.span,
Expand Down
Loading