Skip to content

Commit e49980a

Browse files
committed
---
yaml --- r: 77047 b: refs/heads/snap-stage3 c: a02a759 h: refs/heads/master i: 77045: 5776fd0 77043: 51b339e 77039: c839d30 v: v3
1 parent 4089af8 commit e49980a

Some content is hidden

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

72 files changed

+962
-2161
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: f1132496dddbdd88f321a7919eec3d65136b3f75
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: b795fab046ca1b218785bee5ec5af7326ef9fc85
4+
refs/heads/snap-stage3: a02a759f14be11ceb012796a79828b062d491a09
55
refs/heads/try: ebfe63cd1c0b5d23f7ea60c69b4fde2e30cfd42a
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/mk/rt.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,10 @@ rt/$(1)/stage$(2)/arch/$$(HOST_$(1))/libmorestack.a: $$(MORESTACK_OBJ_$(1)_$(2))
147147
$$(Q)$(AR_$(1)) rcs $$@ $$<
148148

149149
rt/$(1)/stage$(2)/$(CFG_RUNTIME_$(1)): $$(RUNTIME_OBJS_$(1)_$(2)) $$(MKFILE_DEPS) \
150-
$$(RUNTIME_DEF_$(1)_$(2)) $$(LIBUV_LIB_$(1)_$(2)) $$(JEMALLOC_LIB_$(1)_$(2))
150+
$$(RUNTIME_DEF_$(1)_$(2)) $$(LIBUV_LIB_$(1)_$(2))
151151
@$$(call E, link: $$@)
152152
$$(Q)$$(call CFG_LINK_CXX_$(1),$$@, $$(RUNTIME_OBJS_$(1)_$(2)) \
153-
$$(JEMALLOC_LIB_$(1)_$(2)) $$(CFG_GCCISH_POST_LIB_FLAGS_$(1)) $$(LIBUV_LIB_$(1)_$(2)) \
153+
$$(CFG_GCCISH_POST_LIB_FLAGS_$(1)) $$(LIBUV_LIB_$(1)_$(2)) \
154154
$$(CFG_LIBUV_LINK_FLAGS_$(1)),$$(RUNTIME_DEF_$(1)_$(2)),$$(CFG_RUNTIME_$(1)))
155155

156156
# FIXME: For some reason libuv's makefiles can't figure out the

branches/snap-stage3/src/compiletest/runtest.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ use std::os;
2626
use std::str;
2727
use std::task::{spawn_sched, SingleThreaded};
2828
use std::vec;
29-
use std::unstable::running_on_valgrind;
3029

3130
use extra::test::MetricMap;
3231

@@ -39,21 +38,11 @@ pub fn run(config: config, testfile: ~str) {
3938
// that destroys parallelism if we let normal schedulers block.
4039
// It should be possible to remove this spawn once std::run is
4140
// rewritten to be non-blocking.
42-
//
43-
// We do _not_ create another thread if we're running on V because
44-
// it serializes all threads anyways.
45-
if running_on_valgrind() {
41+
do spawn_sched(SingleThreaded) {
4642
let config = config.take();
4743
let testfile = testfile.take();
4844
let mut _mm = MetricMap::new();
4945
run_metrics(config, testfile, &mut _mm);
50-
} else {
51-
do spawn_sched(SingleThreaded) {
52-
let config = config.take();
53-
let testfile = testfile.take();
54-
let mut _mm = MetricMap::new();
55-
run_metrics(config, testfile, &mut _mm);
56-
}
5746
}
5847
}
5948

branches/snap-stage3/src/librustc/metadata/decoder.rs

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -375,21 +375,9 @@ pub fn get_trait_def(cdata: cmd,
375375
let tp_defs = item_ty_param_defs(item_doc, tcx, cdata,
376376
tag_items_data_item_ty_param_bounds);
377377
let rp = item_ty_region_param(item_doc);
378-
let mut bounds = ty::EmptyBuiltinBounds();
379-
// Collect the builtin bounds from the encoded supertraits.
380-
// FIXME(#8559): They should be encoded directly.
381-
do reader::tagged_docs(item_doc, tag_item_super_trait_ref) |trait_doc| {
382-
// NB. Bypasses real supertraits. See get_supertraits() if you wanted them.
383-
let trait_ref = doc_trait_ref(trait_doc, tcx, cdata);
384-
do tcx.lang_items.to_builtin_kind(trait_ref.def_id).map_move |bound| {
385-
bounds.add(bound);
386-
};
387-
true
388-
};
389378
ty::TraitDef {
390379
generics: ty::Generics {type_param_defs: tp_defs,
391380
region_param: rp},
392-
bounds: bounds,
393381
trait_ref: @item_trait_ref(item_doc, tcx, cdata)
394382
}
395383
}
@@ -941,13 +929,7 @@ pub fn get_supertraits(cdata: cmd, id: ast::NodeId, tcx: ty::ctxt)
941929
let mut results = ~[];
942930
let item_doc = lookup_item(id, cdata.data);
943931
do reader::tagged_docs(item_doc, tag_item_super_trait_ref) |trait_doc| {
944-
// NB. Only reads the ones that *aren't* builtin-bounds. See also
945-
// get_trait_def() for collecting the builtin bounds.
946-
// FIXME(#8559): The builtin bounds shouldn't be encoded in the first place.
947-
let trait_ref = doc_trait_ref(trait_doc, tcx, cdata);
948-
if tcx.lang_items.to_builtin_kind(trait_ref.def_id).is_none() {
949-
results.push(@trait_ref);
950-
}
932+
results.push(@doc_trait_ref(trait_doc, tcx, cdata));
951933
true
952934
};
953935
return results;

branches/snap-stage3/src/librustc/metadata/encoder.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,9 +1076,6 @@ fn encode_info_for_item(ecx: &EncodeContext,
10761076
ebml_w.end_tag();
10771077
}
10781078
encode_path(ecx, ebml_w, path, ast_map::path_name(item.ident));
1079-
// FIXME(#8559): This should use the tcx's supertrait cache instead of
1080-
// reading the AST's list, because the former has already filtered out
1081-
// the builtin-kinds-as-supertraits. See corresponding fixme in decoder.
10821079
for ast_trait_ref in super_traits.iter() {
10831080
let trait_ref = ty::node_id_to_trait_ref(ecx.tcx, ast_trait_ref.ref_id);
10841081
encode_trait_ref(ebml_w, ecx, trait_ref, tag_item_super_trait_ref);

branches/snap-stage3/src/librustc/middle/borrowck/check_loans.rs

Lines changed: 34 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ use syntax::ast::{m_mutbl, m_imm, m_const};
2727
use syntax::ast;
2828
use syntax::ast_util;
2929
use syntax::codemap::span;
30-
use syntax::visit;
31-
use syntax::visit::Visitor;
30+
use syntax::oldvisit;
3231
use util::ppaux::Repr;
3332

3433
#[deriving(Clone)]
@@ -40,27 +39,6 @@ struct CheckLoanCtxt<'self> {
4039
reported: @mut HashSet<ast::NodeId>,
4140
}
4241

43-
struct CheckLoanVisitor;
44-
45-
impl<'self> Visitor<CheckLoanCtxt<'self>> for CheckLoanVisitor {
46-
fn visit_expr<'a>(&mut self, ex:@ast::expr, e:CheckLoanCtxt<'a>) {
47-
check_loans_in_expr(self, ex, e);
48-
}
49-
fn visit_local(&mut self, l:@ast::Local, e:CheckLoanCtxt) {
50-
check_loans_in_local(self, l, e);
51-
}
52-
fn visit_block(&mut self, b:&ast::Block, e:CheckLoanCtxt) {
53-
check_loans_in_block(self, b, e);
54-
}
55-
fn visit_pat(&mut self, p:@ast::pat, e:CheckLoanCtxt) {
56-
check_loans_in_pat(self, p, e);
57-
}
58-
fn visit_fn(&mut self, fk:&visit::fn_kind, fd:&ast::fn_decl,
59-
b:&ast::Block, s:span, n:ast::NodeId, e:CheckLoanCtxt) {
60-
check_loans_in_fn(self, fk, fd, b, s, n, e);
61-
}
62-
}
63-
6442
pub fn check_loans(bccx: @BorrowckCtxt,
6543
dfcx_loans: &LoanDataFlow,
6644
move_data: move_data::FlowedMoveData,
@@ -76,8 +54,15 @@ pub fn check_loans(bccx: @BorrowckCtxt,
7654
reported: @mut HashSet::new(),
7755
};
7856

79-
let mut vt = CheckLoanVisitor;
80-
vt.visit_block(body, clcx);
57+
let vt = oldvisit::mk_vt(@oldvisit::Visitor {
58+
visit_expr: check_loans_in_expr,
59+
visit_local: check_loans_in_local,
60+
visit_block: check_loans_in_block,
61+
visit_pat: check_loans_in_pat,
62+
visit_fn: check_loans_in_fn,
63+
.. *oldvisit::default_visitor()
64+
});
65+
(vt.visit_block)(body, (clcx, vt));
8166
}
8267

8368
enum MoveError {
@@ -641,27 +626,27 @@ impl<'self> CheckLoanCtxt<'self> {
641626
}
642627
}
643628

644-
fn check_loans_in_fn<'a>(visitor: &mut CheckLoanVisitor,
645-
fk: &visit::fn_kind,
629+
fn check_loans_in_fn<'a>(fk: &oldvisit::fn_kind,
646630
decl: &ast::fn_decl,
647631
body: &ast::Block,
648632
sp: span,
649633
id: ast::NodeId,
650-
this: CheckLoanCtxt<'a>) {
634+
(this, visitor): (CheckLoanCtxt<'a>,
635+
oldvisit::vt<CheckLoanCtxt<'a>>)) {
651636
match *fk {
652-
visit::fk_item_fn(*) |
653-
visit::fk_method(*) => {
637+
oldvisit::fk_item_fn(*) |
638+
oldvisit::fk_method(*) => {
654639
// Don't process nested items.
655640
return;
656641
}
657642

658-
visit::fk_anon(*) |
659-
visit::fk_fn_block(*) => {
643+
oldvisit::fk_anon(*) |
644+
oldvisit::fk_fn_block(*) => {
660645
check_captured_variables(this, id, sp);
661646
}
662647
}
663648

664-
visit::walk_fn(visitor, fk, decl, body, sp, id, this);
649+
oldvisit::visit_fn(fk, decl, body, sp, id, (this, visitor));
665650

666651
fn check_captured_variables(this: CheckLoanCtxt,
667652
closure_id: ast::NodeId,
@@ -704,16 +689,16 @@ fn check_loans_in_fn<'a>(visitor: &mut CheckLoanVisitor,
704689
}
705690
}
706691

707-
fn check_loans_in_local<'a>(vt: &mut CheckLoanVisitor,
708-
local: @ast::Local,
709-
this: CheckLoanCtxt<'a>) {
710-
visit::walk_local(vt, local, this);
692+
fn check_loans_in_local<'a>(local: @ast::Local,
693+
(this, vt): (CheckLoanCtxt<'a>,
694+
oldvisit::vt<CheckLoanCtxt<'a>>)) {
695+
oldvisit::visit_local(local, (this, vt));
711696
}
712697

713-
fn check_loans_in_expr<'a>(vt: &mut CheckLoanVisitor,
714-
expr: @ast::expr,
715-
this: CheckLoanCtxt<'a>) {
716-
visit::walk_expr(vt, expr, this);
698+
fn check_loans_in_expr<'a>(expr: @ast::expr,
699+
(this, vt): (CheckLoanCtxt<'a>,
700+
oldvisit::vt<CheckLoanCtxt<'a>>)) {
701+
oldvisit::visit_expr(expr, (this, vt));
717702

718703
debug!("check_loans_in_expr(expr=%s)",
719704
expr.repr(this.tcx()));
@@ -764,19 +749,19 @@ fn check_loans_in_expr<'a>(vt: &mut CheckLoanVisitor,
764749
}
765750
}
766751

767-
fn check_loans_in_pat<'a>(vt: &mut CheckLoanVisitor,
768-
pat: @ast::pat,
769-
this: CheckLoanCtxt<'a>)
752+
fn check_loans_in_pat<'a>(pat: @ast::pat,
753+
(this, vt): (CheckLoanCtxt<'a>,
754+
oldvisit::vt<CheckLoanCtxt<'a>>))
770755
{
771756
this.check_for_conflicting_loans(pat.id);
772757
this.check_move_out_from_id(pat.id, pat.span);
773-
visit::walk_pat(vt, pat, this);
758+
oldvisit::visit_pat(pat, (this, vt));
774759
}
775760

776-
fn check_loans_in_block<'a>(vt: &mut CheckLoanVisitor,
777-
blk: &ast::Block,
778-
this: CheckLoanCtxt<'a>)
761+
fn check_loans_in_block<'a>(blk: &ast::Block,
762+
(this, vt): (CheckLoanCtxt<'a>,
763+
oldvisit::vt<CheckLoanCtxt<'a>>))
779764
{
780-
visit::walk_block(vt, blk, this);
765+
oldvisit::visit_block(blk, (this, vt));
781766
this.check_for_conflicting_loans(blk.id);
782767
}

branches/snap-stage3/src/librustc/middle/entry.rs

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ use syntax::ast::{Crate, NodeId, item, item_fn};
1515
use syntax::ast_map;
1616
use syntax::attr;
1717
use syntax::codemap::span;
18+
use syntax::oldvisit::{default_visitor, mk_vt, vt, Visitor, visit_crate};
19+
use syntax::oldvisit::{visit_item};
1820
use syntax::parse::token::special_idents;
19-
use syntax::visit;
20-
use syntax::visit::Visitor;
2121
use std::util;
2222

2323
struct EntryContext {
@@ -39,13 +39,7 @@ struct EntryContext {
3939
non_main_fns: ~[(NodeId, span)],
4040
}
4141

42-
struct EntryVisitor;
43-
44-
impl Visitor<@mut EntryContext> for EntryVisitor {
45-
fn visit_item(&mut self, item:@item, ctxt:@mut EntryContext) {
46-
find_item(item, ctxt, self);
47-
}
48-
}
42+
type EntryVisitor = vt<@mut EntryContext>;
4943

5044
pub fn find_entry_point(session: Session, crate: &Crate, ast_map: ast_map::map) {
5145

@@ -71,14 +65,15 @@ pub fn find_entry_point(session: Session, crate: &Crate, ast_map: ast_map::map)
7165
non_main_fns: ~[],
7266
};
7367

74-
let mut v = EntryVisitor;
75-
76-
visit::walk_crate(&mut v, crate, ctxt);
68+
visit_crate(crate, (ctxt, mk_vt(@Visitor {
69+
visit_item: |item, (ctxt, visitor)| find_item(item, ctxt, visitor),
70+
.. *default_visitor()
71+
})));
7772

7873
configure_main(ctxt);
7974
}
8075

81-
fn find_item(item: @item, ctxt: @mut EntryContext, visitor: &mut EntryVisitor) {
76+
fn find_item(item: @item, ctxt: @mut EntryContext, visitor: EntryVisitor) {
8277
match item.node {
8378
item_fn(*) => {
8479
if item.ident == special_idents::main {
@@ -125,7 +120,7 @@ fn find_item(item: @item, ctxt: @mut EntryContext, visitor: &mut EntryVisitor) {
125120
_ => ()
126121
}
127122

128-
visit::walk_item(visitor, item, ctxt);
123+
visit_item(item, (ctxt, visitor));
129124
}
130125

131126
fn configure_main(ctxt: @mut EntryContext) {

0 commit comments

Comments
 (0)