Skip to content

Commit 5d716a7

Browse files
committed
---
yaml --- r: 149085 b: refs/heads/try2 c: fd4979a h: refs/heads/master i: 149083: 5603134 v: v3
1 parent 797c59b commit 5d716a7

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
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: d2d1129ad071653e32709706bb16606506ca227a
8+
refs/heads/try2: fd4979ad0427aca01e500d0d26350525e9e17f2d
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/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)

branches/try2/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+

branches/try2/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)