Skip to content

Commit 678d9e3

Browse files
author
Keegan McAllister
committed
---
yaml --- r: 171377 b: refs/heads/batch c: e2a9c04 h: refs/heads/master i: 171375: bd7b189 v: v3
1 parent 9888757 commit 678d9e3

File tree

4 files changed

+46
-1
lines changed

4 files changed

+46
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
2929
refs/heads/issue-18208-method-dispatch-2: 9e1eae4fb9b6527315b4441cf8a0f5ca911d1671
3030
refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3131
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
32-
refs/heads/batch: ad7c64777380a780b42028855ad0d09932a11623
32+
refs/heads/batch: e2a9c04e192926fde1a8e886b55e4c2b6e0e56cb
3333
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
3434
refs/heads/beta: 496dc4eae7de9d14cd49511a9acfbf5f11ae6c3f
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928

branches/batch/src/libsyntax/parse/parser.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5973,6 +5973,10 @@ impl<'a> Parser<'a> {
59735973
fn parse_view_path(&mut self) -> P<ViewPath> {
59745974
let lo = self.span.lo;
59755975

5976+
// Allow a leading :: because the paths are absolute either way.
5977+
// This occurs with "use $crate::..." in macros.
5978+
self.eat(&token::ModSep);
5979+
59765980
if self.check(&token::OpenDelim(token::Brace)) {
59775981
// use {foo,bar}
59785982
let idents = self.parse_unspanned_seq(
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
fn main() {
12+
use ::std::mem;
13+
mem::drop(2u);
14+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
#![feature(macro_rules)]
12+
13+
pub fn increment(x: uint) -> uint {
14+
x + 1
15+
}
16+
17+
#[macro_export]
18+
macro_rules! increment {
19+
($x:expr) => ({
20+
use $crate::increment;
21+
increment($x)
22+
})
23+
}
24+
25+
fn main() {
26+
assert_eq!(increment!(3), 4);
27+
}

0 commit comments

Comments
 (0)