Skip to content

Commit 46aefb6

Browse files
committed
---
yaml --- r: 101699 b: refs/heads/master c: fd4979a h: refs/heads/master i: 101697: 4012bb0 101695: 373f41a v: v3
1 parent be600f2 commit 46aefb6

File tree

6 files changed

+50
-12
lines changed

6 files changed

+50
-12
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: d2d1129ad071653e32709706bb16606506ca227a
2+
refs/heads/master: fd4979ad0427aca01e500d0d26350525e9e17f2d
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6e7f170fedd3c526a643c0b2d13863acd982be02
55
refs/heads/try: a97642026c18a624ff6ea01075dd9550f8ed07ff

trunk/src/libsyntax/ext/expand.rs

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -394,15 +394,20 @@ pub fn expand_item_mac(it: @ast::Item, fld: &mut MacroExpander)
394394
pub fn expand_view_item(vi: &ast::ViewItem,
395395
fld: &mut MacroExpander)
396396
-> ast::ViewItem {
397-
let should_load = vi.attrs.iter().any(|attr| {
398-
attr.name().get() == "phase" &&
399-
attr.meta_item_list().map_or(false, |phases| {
400-
attr::contains_name(phases, "syntax")
401-
})
402-
});
397+
match vi.node {
398+
ast::ViewItemExternMod(..) => {
399+
let should_load = vi.attrs.iter().any(|attr| {
400+
attr.name().get() == "phase" &&
401+
attr.meta_item_list().map_or(false, |phases| {
402+
attr::contains_name(phases, "syntax")
403+
})
404+
});
403405

404-
if should_load {
405-
load_extern_macros(vi, fld);
406+
if should_load {
407+
load_extern_macros(vi, fld);
408+
}
409+
}
410+
ast::ViewItemUse(_) => {}
406411
}
407412

408413
noop_fold_view_item(vi, fld)

trunk/src/libsyntax/parse/token.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,7 @@ declare_special_idents_and_keywords! {
492492
(53, Typeof, "typeof");
493493
(54, Unsized, "unsized");
494494
(55, Yield, "yield");
495+
(56, Do, "do");
495496
}
496497
}
497498

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
fn main() {
12+
let do = "bar"; //~ error: ident
13+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
//xfail-fast
12+
13+
#[feature(phase)];
14+
15+
#[phase(syntax)]
16+
use std::mem;
17+
18+
fn main() {}
19+

trunk/src/test/run-pass/temporary-lifetime-for-conditions.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ impl Drop for Temporary {
2323
}
2424

2525
impl Temporary {
26-
fn do(&self) -> bool {true}
26+
fn do_stuff(&self) -> bool {true}
2727
}
2828

2929
fn borrow() -> ~Temporary { ~Temporary }
@@ -35,7 +35,7 @@ pub fn main() {
3535
// This loop's condition
3636
// should call `Temporary`'s
3737
// `drop` 6 times.
38-
while borrow().do() {
38+
while borrow().do_stuff() {
3939
i += 1;
4040
if i > 5 {
4141
break;
@@ -44,7 +44,7 @@ pub fn main() {
4444

4545
// This if condition should
4646
// call it 1 time
47-
if borrow().do() {
47+
if borrow().do_stuff() {
4848
unsafe { assert_eq!(DROPPED, 7) }
4949
}
5050
}

0 commit comments

Comments
 (0)