Skip to content

Commit 54bb930

Browse files
committed
---
yaml --- r: 94811 b: refs/heads/try c: 28a091f h: refs/heads/master i: 94809: 2684ee9 94807: 5843c64 v: v3
1 parent 9f70a38 commit 54bb930

Some content is hidden

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

46 files changed

+405
-451
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 0da105a8b7b6b1e0568e8ff20f6ff4b13cc7ecc2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d3e57dca68fde4effdda3e4ae2887aa535fcd6
5-
refs/heads/try: 01209f1e3aed4cd0960fe81dd1d1470650ae8b85
5+
refs/heads/try: 28a091fc7c7e23eee346d87fd34ea1546002ee2c
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[submodule "src/llvm"]
22
path = src/llvm
3-
url = https://github.com/alexcrichton/llvm.git
3+
url = https://github.com/luqmana/llvm.git
44
branch = master
55
[submodule "src/libuv"]
66
path = src/libuv

branches/try/src/libgreen/sched.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1433,7 +1433,7 @@ mod test {
14331433
drop(handle);
14341434

14351435
let mut handle = pool.spawn_sched();
1436-
handle.send(TaskFromFriend(pool.task(TaskOpts::new(), proc() {
1436+
handle.send(PinnedTask(pool.task(TaskOpts::new(), proc() {
14371437
// Wait until the other task has its lock
14381438
start_po.recv();
14391439

branches/try/src/librustc/front/assign_node_ids.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ struct NodeIdAssigner {
1818
}
1919

2020
impl ast_fold for NodeIdAssigner {
21-
fn new_id(&self, old_id: ast::NodeId) -> ast::NodeId {
21+
fn new_id(&mut self, old_id: ast::NodeId) -> ast::NodeId {
2222
assert_eq!(old_id, ast::DUMMY_NODE_ID);
2323
self.sess.next_node_id()
2424
}
2525
}
2626

2727
pub fn assign_node_ids(sess: Session, crate: ast::Crate) -> ast::Crate {
28-
let fold = NodeIdAssigner {
28+
let mut fold = NodeIdAssigner {
2929
sess: sess,
3030
};
3131
fold.fold_crate(crate)

branches/try/src/librustc/front/config.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,25 +24,25 @@ pub fn strip_unconfigured_items(crate: ast::Crate) -> ast::Crate {
2424
}
2525

2626
impl<'a> fold::ast_fold for Context<'a> {
27-
fn fold_mod(&self, module: &ast::_mod) -> ast::_mod {
27+
fn fold_mod(&mut self, module: &ast::_mod) -> ast::_mod {
2828
fold_mod(self, module)
2929
}
30-
fn fold_block(&self, block: ast::P<ast::Block>) -> ast::P<ast::Block> {
30+
fn fold_block(&mut self, block: ast::P<ast::Block>) -> ast::P<ast::Block> {
3131
fold_block(self, block)
3232
}
33-
fn fold_foreign_mod(&self, foreign_module: &ast::foreign_mod)
33+
fn fold_foreign_mod(&mut self, foreign_module: &ast::foreign_mod)
3434
-> ast::foreign_mod {
3535
fold_foreign_mod(self, foreign_module)
3636
}
37-
fn fold_item_underscore(&self, item: &ast::item_) -> ast::item_ {
37+
fn fold_item_underscore(&mut self, item: &ast::item_) -> ast::item_ {
3838
fold_item_underscore(self, item)
3939
}
4040
}
4141

4242
pub fn strip_items(crate: ast::Crate,
4343
in_cfg: |attrs: &[ast::Attribute]| -> bool)
4444
-> ast::Crate {
45-
let ctxt = Context {
45+
let mut ctxt = Context {
4646
in_cfg: in_cfg,
4747
};
4848
ctxt.fold_crate(crate)
@@ -57,7 +57,7 @@ fn filter_view_item<'r>(cx: &Context, view_item: &'r ast::view_item)
5757
}
5858
}
5959

60-
fn fold_mod(cx: &Context, m: &ast::_mod) -> ast::_mod {
60+
fn fold_mod(cx: &mut Context, m: &ast::_mod) -> ast::_mod {
6161
let filtered_items = m.items.iter()
6262
.filter(|&a| item_in_cfg(cx, *a))
6363
.flat_map(|&x| cx.fold_item(x).move_iter())
@@ -80,7 +80,7 @@ fn filter_foreign_item(cx: &Context, item: @ast::foreign_item)
8080
}
8181
}
8282

83-
fn fold_foreign_mod(cx: &Context, nm: &ast::foreign_mod) -> ast::foreign_mod {
83+
fn fold_foreign_mod(cx: &mut Context, nm: &ast::foreign_mod) -> ast::foreign_mod {
8484
let filtered_items = nm.items
8585
.iter()
8686
.filter_map(|a| filter_foreign_item(cx, *a))
@@ -95,7 +95,7 @@ fn fold_foreign_mod(cx: &Context, nm: &ast::foreign_mod) -> ast::foreign_mod {
9595
}
9696
}
9797

98-
fn fold_item_underscore(cx: &Context, item: &ast::item_) -> ast::item_ {
98+
fn fold_item_underscore(cx: &mut Context, item: &ast::item_) -> ast::item_ {
9999
let item = match *item {
100100
ast::item_impl(ref a, ref b, c, ref methods) => {
101101
let methods = methods.iter().filter(|m| method_in_cfg(cx, **m))
@@ -129,7 +129,7 @@ fn retain_stmt(cx: &Context, stmt: @ast::Stmt) -> bool {
129129
}
130130
}
131131

132-
fn fold_block(cx: &Context, b: ast::P<ast::Block>) -> ast::P<ast::Block> {
132+
fn fold_block(cx: &mut Context, b: ast::P<ast::Block>) -> ast::P<ast::Block> {
133133
let resulting_stmts = b.stmts.iter()
134134
.filter(|&a| retain_stmt(cx, *a))
135135
.flat_map(|&stmt| cx.fold_stmt(stmt).move_iter())

branches/try/src/librustc/front/std_inject.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ struct StandardLibraryInjector {
5656
}
5757

5858
impl fold::ast_fold for StandardLibraryInjector {
59-
fn fold_crate(&self, crate: ast::Crate) -> ast::Crate {
59+
fn fold_crate(&mut self, crate: ast::Crate) -> ast::Crate {
6060
let version = STD_VERSION.to_managed();
6161
let vers_item = attr::mk_name_value_item_str(@"vers", version);
6262
let mut vis = ~[ast::view_item {
@@ -108,7 +108,7 @@ impl fold::ast_fold for StandardLibraryInjector {
108108
}
109109
}
110110

111-
fn fold_item(&self, item: @ast::item) -> SmallVector<@ast::item> {
111+
fn fold_item(&mut self, item: @ast::item) -> SmallVector<@ast::item> {
112112
if !no_prelude(item.attrs) {
113113
// only recur if there wasn't `#[no_implicit_prelude];`
114114
// on this item, i.e. this means that the prelude is not
@@ -119,7 +119,7 @@ impl fold::ast_fold for StandardLibraryInjector {
119119
}
120120
}
121121

122-
fn fold_mod(&self, module: &ast::_mod) -> ast::_mod {
122+
fn fold_mod(&mut self, module: &ast::_mod) -> ast::_mod {
123123
let prelude_path = ast::Path {
124124
span: dummy_sp(),
125125
global: false,
@@ -158,7 +158,7 @@ impl fold::ast_fold for StandardLibraryInjector {
158158
}
159159

160160
fn inject_libstd_ref(sess: Session, crate: ast::Crate) -> ast::Crate {
161-
let fold = StandardLibraryInjector {
161+
let mut fold = StandardLibraryInjector {
162162
sess: sess,
163163
};
164164
fold.fold_crate(crate)

branches/try/src/librustc/front/test.rs

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ struct Test {
4040
struct TestCtxt {
4141
sess: session::Session,
4242
path: RefCell<~[ast::Ident]>,
43-
ext_cx: @ExtCtxt,
43+
ext_cx: ExtCtxt,
4444
testfns: RefCell<~[Test]>,
4545
is_extra: bool,
4646
config: ast::CrateConfig,
@@ -63,30 +63,30 @@ pub fn modify_for_testing(sess: session::Session,
6363
}
6464

6565
struct TestHarnessGenerator {
66-
cx: @TestCtxt,
66+
cx: TestCtxt,
6767
}
6868

6969
impl fold::ast_fold for TestHarnessGenerator {
70-
fn fold_crate(&self, c: ast::Crate) -> ast::Crate {
70+
fn fold_crate(&mut self, c: ast::Crate) -> ast::Crate {
7171
let folded = fold::noop_fold_crate(c, self);
7272

7373
// Add a special __test module to the crate that will contain code
7474
// generated for the test harness
7575
ast::Crate {
76-
module: add_test_module(self.cx, &folded.module),
76+
module: add_test_module(&self.cx, &folded.module),
7777
.. folded
7878
}
7979
}
8080

81-
fn fold_item(&self, i: @ast::item) -> SmallVector<@ast::item> {
81+
fn fold_item(&mut self, i: @ast::item) -> SmallVector<@ast::item> {
8282
{
8383
let mut path = self.cx.path.borrow_mut();
8484
path.get().push(i.ident);
8585
}
8686
debug!("current path: {}",
8787
ast_util::path_name_i(self.cx.path.get()));
8888

89-
if is_test_fn(self.cx, i) || is_bench_fn(i) {
89+
if is_test_fn(&self.cx, i) || is_bench_fn(i) {
9090
match i.node {
9191
ast::item_fn(_, purity, _, _, _)
9292
if purity == ast::unsafe_fn => {
@@ -101,7 +101,7 @@ impl fold::ast_fold for TestHarnessGenerator {
101101
span: i.span,
102102
path: self.cx.path.get(),
103103
bench: is_bench_fn(i),
104-
ignore: is_ignored(self.cx, i),
104+
ignore: is_ignored(&self.cx, i),
105105
should_fail: should_fail(i)
106106
};
107107
{
@@ -122,11 +122,11 @@ impl fold::ast_fold for TestHarnessGenerator {
122122
res
123123
}
124124

125-
fn fold_mod(&self, m: &ast::_mod) -> ast::_mod {
125+
fn fold_mod(&mut self, m: &ast::_mod) -> ast::_mod {
126126
// Remove any #[main] from the AST so it doesn't clash with
127127
// the one we're going to add. Only if compiling an executable.
128128

129-
fn nomain(cx: @TestCtxt, item: @ast::item) -> @ast::item {
129+
fn nomain(cx: &TestCtxt, item: @ast::item) -> @ast::item {
130130
if !cx.sess.building_library.get() {
131131
@ast::item {
132132
attrs: item.attrs.iter().filter_map(|attr| {
@@ -145,7 +145,7 @@ impl fold::ast_fold for TestHarnessGenerator {
145145

146146
let mod_nomain = ast::_mod {
147147
view_items: m.view_items.clone(),
148-
items: m.items.iter().map(|i| nomain(self.cx, *i)).collect(),
148+
items: m.items.iter().map(|i| nomain(&self.cx, *i)).collect(),
149149
};
150150

151151
fold::noop_fold_mod(&mod_nomain, self)
@@ -154,7 +154,7 @@ impl fold::ast_fold for TestHarnessGenerator {
154154

155155
fn generate_test_harness(sess: session::Session, crate: ast::Crate)
156156
-> ast::Crate {
157-
let cx: @TestCtxt = @TestCtxt {
157+
let mut cx: TestCtxt = TestCtxt {
158158
sess: sess,
159159
ext_cx: ExtCtxt::new(sess.parse_sess, sess.opts.cfg.clone()),
160160
path: RefCell::new(~[]),
@@ -163,8 +163,7 @@ fn generate_test_harness(sess: session::Session, crate: ast::Crate)
163163
config: crate.config.clone(),
164164
};
165165

166-
let ext_cx = cx.ext_cx;
167-
ext_cx.bt_push(ExpnInfo {
166+
cx.ext_cx.bt_push(ExpnInfo {
168167
call_site: dummy_sp(),
169168
callee: NameAndSpan {
170169
name: @"test",
@@ -173,11 +172,11 @@ fn generate_test_harness(sess: session::Session, crate: ast::Crate)
173172
}
174173
});
175174

176-
let fold = TestHarnessGenerator {
175+
let mut fold = TestHarnessGenerator {
177176
cx: cx
178177
};
179178
let res = fold.fold_crate(crate);
180-
ext_cx.bt_pop();
179+
fold.cx.ext_cx.bt_pop();
181180
return res;
182181
}
183182

@@ -190,7 +189,7 @@ fn strip_test_functions(crate: ast::Crate) -> ast::Crate {
190189
})
191190
}
192191

193-
fn is_test_fn(cx: @TestCtxt, i: @ast::item) -> bool {
192+
fn is_test_fn(cx: &TestCtxt, i: @ast::item) -> bool {
194193
let has_test_attr = attr::contains_name(i.attrs, "test");
195194

196195
fn has_test_signature(i: @ast::item) -> bool {
@@ -243,7 +242,7 @@ fn is_bench_fn(i: @ast::item) -> bool {
243242
return has_bench_attr && has_test_signature(i);
244243
}
245244

246-
fn is_ignored(cx: @TestCtxt, i: @ast::item) -> bool {
245+
fn is_ignored(cx: &TestCtxt, i: @ast::item) -> bool {
247246
i.attrs.iter().any(|attr| {
248247
// check ignore(cfg(foo, bar))
249248
"ignore" == attr.name() && match attr.meta_item_list() {
@@ -313,7 +312,7 @@ fn mk_test_module(cx: &TestCtxt) -> @ast::item {
313312

314313
// The synthesized main function which will call the console test runner
315314
// with our list of tests
316-
let mainfn = (quote_item!(cx.ext_cx,
315+
let mainfn = (quote_item!(&cx.ext_cx,
317316
pub fn main() {
318317
#[main];
319318
extra::test::test_main_static(::std::os::args(), TESTS);
@@ -377,7 +376,7 @@ fn mk_tests(cx: &TestCtxt) -> @ast::item {
377376
// The vector of test_descs for this crate
378377
let test_descs = mk_test_descs(cx);
379378

380-
(quote_item!(cx.ext_cx,
379+
(quote_item!(&cx.ext_cx,
381380
pub static TESTS : &'static [self::extra::test::TestDescAndFn] =
382381
$test_descs
383382
;
@@ -438,24 +437,24 @@ fn mk_test_desc_and_fn_rec(cx: &TestCtxt, test: &Test) -> @ast::Expr {
438437
};
439438

440439
let t_expr = if test.bench {
441-
quote_expr!(cx.ext_cx, self::extra::test::StaticBenchFn($fn_expr) )
440+
quote_expr!(&cx.ext_cx, self::extra::test::StaticBenchFn($fn_expr) )
442441
} else {
443-
quote_expr!(cx.ext_cx, self::extra::test::StaticTestFn($fn_expr) )
442+
quote_expr!(&cx.ext_cx, self::extra::test::StaticTestFn($fn_expr) )
444443
};
445444

446445
let ignore_expr = if test.ignore {
447-
quote_expr!(cx.ext_cx, true )
446+
quote_expr!(&cx.ext_cx, true )
448447
} else {
449-
quote_expr!(cx.ext_cx, false )
448+
quote_expr!(&cx.ext_cx, false )
450449
};
451450

452451
let fail_expr = if test.should_fail {
453-
quote_expr!(cx.ext_cx, true )
452+
quote_expr!(&cx.ext_cx, true )
454453
} else {
455-
quote_expr!(cx.ext_cx, false )
454+
quote_expr!(&cx.ext_cx, false )
456455
};
457456

458-
let e = quote_expr!(cx.ext_cx,
457+
let e = quote_expr!(&cx.ext_cx,
459458
self::extra::test::TestDescAndFn {
460459
desc: self::extra::test::TestDesc {
461460
name: self::extra::test::StaticTestName($name_expr),

branches/try/src/librustc/middle/astencode.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ struct NestedItemsDropper {
301301
}
302302

303303
impl fold::ast_fold for NestedItemsDropper {
304-
fn fold_block(&self, blk: ast::P<ast::Block>) -> ast::P<ast::Block> {
304+
fn fold_block(&mut self, blk: ast::P<ast::Block>) -> ast::P<ast::Block> {
305305
let stmts_sans_items = blk.stmts.iter().filter_map(|stmt| {
306306
match stmt.node {
307307
ast::StmtExpr(_, _) | ast::StmtSemi(_, _) |
@@ -340,7 +340,7 @@ impl fold::ast_fold for NestedItemsDropper {
340340
// nested items, as otherwise it would get confused when translating
341341
// inlined items.
342342
fn simplify_ast(ii: &ast::inlined_item) -> ast::inlined_item {
343-
let fld = NestedItemsDropper {
343+
let mut fld = NestedItemsDropper {
344344
contents: (),
345345
};
346346

@@ -365,17 +365,17 @@ struct AstRenumberer {
365365
}
366366

367367
impl fold::ast_fold for AstRenumberer {
368-
fn new_id(&self, id: ast::NodeId) -> ast::NodeId {
368+
fn new_id(&mut self, id: ast::NodeId) -> ast::NodeId {
369369
self.xcx.tr_id(id)
370370
}
371-
fn new_span(&self, span: Span) -> Span {
371+
fn new_span(&mut self, span: Span) -> Span {
372372
self.xcx.tr_span(span)
373373
}
374374
}
375375

376376
fn renumber_ast(xcx: @ExtendedDecodeContext, ii: ast::inlined_item)
377377
-> ast::inlined_item {
378-
let fld = AstRenumberer {
378+
let mut fld = AstRenumberer {
379379
xcx: xcx,
380380
};
381381
match ii {

0 commit comments

Comments
 (0)