Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit afdd0b8

Browse files
committedMar 2, 2013
auto merge of #5143 : erickt/rust/incoming, r=pcwalton
Good morning, It's taken a long time, but I finally am almost done freeing libsyntax of `vecs_implicitly_copyable` in this pull request, but I'm running into some issues. I've confirmed that all but the last commit (which only disables `vecs_implicitly_copyable` pass the `check` tests. The last commit errors with this message, which makes no sense to me: ``` /Users/erickt/rust/rust/src/libcore/num/f32.rs:35:37: 35:43 error: expected `,` but found `=` /Users/erickt/rust/rust/src/libcore/num/f32.rs:35 pub pure fn $name($( $arg : $arg_ty ),*) -> $rv { ^~~~~~ ``` and this stack trace: ``` #1 0x00000001000b059b in sys::begin_unwind_::_a923ca4ae164c::_06 () #2 0x00000001000b0542 in sys::begin_unwind::anon::anon::expr_fn_13876 () #3 0x00000001000048a1 in sys::begin_unwind::_8ec273289fc0adc0::_06 () #4 0x00000001005df999 in diagnostic::__extensions__::meth_7941::span_fatal::_efdf2d14612d79ec::_06 () #5 0x0000000100682d48 in parse::parser::__extensions__::meth_16938::fatal::_8aa3239426747a3::_06 () #6 0x00000001006850b8 in parse::common::__extensions__::meth_17005::expect::_d3604ec6c7698d5f::_06 () #7 0x00000001006b59f1 in parse::common::__extensions__::parse_seq_to_before_end_17860::_48c79835f9eb1011::_06 () #8 0x00000001006a50f7 in parse::parser::__extensions__::meth_17606::parse_fn_decl::_14f3785fe78967d::_06 () #9 0x00000001006b6f59 in parse::parser::__extensions__::meth_17987::parse_item_fn::_8a6be529cf7b2ca5::_06 () #10 0x00000001006ac839 in parse::parser::__extensions__::meth_17761::parse_item_or_view_item::_bfead947d6dd7d25::_06 () #11 0x00000001006c8b8f in parse::parser::__extensions__::meth_18364::parse_item::_96b54e33f65abe76::_06 () #12 0x000000010076179f in ext::tt::macro_rules::add_new_extension::generic_extension::anon::anon::expr_fn_23365 () #13 0x000000010072e793 in ext::expand::expand_item_mac::_a4f486c4465cfb1b::_06 () #14 0x00000001007b5ad3 in __morestack () ``` There also a bunch of new warnings that I haven't cleaned up yet: https://gist.github.com/erickt/5048251. @nikomatsakis thought there might be some scary bug in the parser caused by moving a vector in the parser instead of copying it, which is why I'm filing this pull request before it's ready. Thanks for any help!
2 parents 2304fe6 + 5515fd5 commit afdd0b8

Some content is hidden

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

77 files changed

+2868
-2257
lines changed
 

‎src/librustc/middle/astencode.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ fn encode_ast(ebml_w: writer::Encoder, item: ast::inlined_item) {
298298
// nested items, as otherwise it would get confused when translating
299299
// inlined items.
300300
fn simplify_ast(ii: ast::inlined_item) -> ast::inlined_item {
301-
fn drop_nested_items(blk: ast::blk_, fld: fold::ast_fold) -> ast::blk_ {
301+
fn drop_nested_items(blk: &ast::blk_, fld: fold::ast_fold) -> ast::blk_ {
302302
let stmts_sans_items = do blk.stmts.filtered |stmt| {
303303
match stmt.node {
304304
ast::stmt_expr(_, _) | ast::stmt_semi(_, _) |
@@ -317,7 +317,7 @@ fn simplify_ast(ii: ast::inlined_item) -> ast::inlined_item {
317317
id: blk.id,
318318
rules: blk.rules
319319
};
320-
fold::noop_fold_block(blk_sans_items, fld)
320+
fold::noop_fold_block(&blk_sans_items, fld)
321321
}
322322
323323
let fld = fold::make_fold(@fold::AstFoldFns {
@@ -336,7 +336,7 @@ fn simplify_ast(ii: ast::inlined_item) -> ast::inlined_item {
336336
ast::ii_foreign(fld.fold_foreign_item(i))
337337
}
338338
ast::ii_dtor(ref dtor, nm, ref tps, parent_id) => {
339-
let dtor_body = fld.fold_block((*dtor).node.body);
339+
let dtor_body = fld.fold_block(&dtor.node.body);
340340
ast::ii_dtor(
341341
codemap::spanned {
342342
node: ast::struct_dtor_ { body: dtor_body,
@@ -372,8 +372,8 @@ fn renumber_ast(xcx: @ExtendedDecodeContext, ii: ast::inlined_item)
372372
ast::ii_foreign(fld.fold_foreign_item(i))
373373
}
374374
ast::ii_dtor(ref dtor, nm, ref generics, parent_id) => {
375-
let dtor_body = fld.fold_block((*dtor).node.body);
376-
let dtor_attrs = fld.fold_attributes(copy dtor.node.attrs);
375+
let dtor_body = fld.fold_block(&dtor.node.body);
376+
let dtor_attrs = fld.fold_attributes(/*bad*/copy (*dtor).node.attrs);
377377
let new_generics = fold::fold_generics(generics, fld);
378378
let dtor_id = fld.new_id((*dtor).node.id);
379379
let new_parent = xcx.tr_def_id(parent_id);

‎src/librustc/middle/borrowck/check_loans.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -579,9 +579,9 @@ pub impl CheckLoanCtxt {
579579
}
580580
}
581581

582-
fn check_loans_in_fn(fk: visit::fn_kind,
583-
decl: ast::fn_decl,
584-
body: ast::blk,
582+
fn check_loans_in_fn(fk: &visit::fn_kind,
583+
decl: &ast::fn_decl,
584+
body: &ast::blk,
585585
sp: span,
586586
id: ast::node_id,
587587
&&self: @mut CheckLoanCtxt,
@@ -590,7 +590,7 @@ fn check_loans_in_fn(fk: visit::fn_kind,
590590
let fty = ty::node_id_to_type(self.tcx(), id);
591591

592592
let declared_purity;
593-
match fk {
593+
match *fk {
594594
visit::fk_item_fn(*) | visit::fk_method(*) |
595595
visit::fk_dtor(*) => {
596596
declared_purity = ty::ty_fn_purity(fty);
@@ -611,7 +611,7 @@ fn check_loans_in_fn(fk: visit::fn_kind,
611611
do save_and_restore_managed(self.fn_args) {
612612
*self.declared_purity = declared_purity;
613613

614-
match fk {
614+
match *fk {
615615
visit::fk_anon(*) |
616616
visit::fk_fn_block(*) if is_stack_closure => {
617617
// inherits the fn_args from enclosing ctxt
@@ -753,7 +753,7 @@ fn check_loans_in_expr(expr: @ast::expr,
753753
visit::visit_expr(expr, self, vt);
754754
}
755755

756-
fn check_loans_in_block(blk: ast::blk,
756+
fn check_loans_in_block(blk: &ast::blk,
757757
&&self: @mut CheckLoanCtxt,
758758
vt: visit::vt<@mut CheckLoanCtxt>) {
759759
do save_and_restore_managed(self.declared_purity) {
There was a problem loading the remainder of the diff.

0 commit comments

Comments
 (0)
Failed to load comments.