File tree Expand file tree Collapse file tree 4 files changed +46
-1
lines changed Expand file tree Collapse file tree 4 files changed +46
-1
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
29
29
refs/heads/issue-18208-method-dispatch-2: 9e1eae4fb9b6527315b4441cf8a0f5ca911d1671
30
30
refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
31
31
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
32
- refs/heads/batch: ad7c64777380a780b42028855ad0d09932a11623
32
+ refs/heads/batch: e2a9c04e192926fde1a8e886b55e4c2b6e0e56cb
33
33
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
34
34
refs/heads/beta: 496dc4eae7de9d14cd49511a9acfbf5f11ae6c3f
35
35
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
Original file line number Diff line number Diff line change @@ -5973,6 +5973,10 @@ impl<'a> Parser<'a> {
5973
5973
fn parse_view_path ( & mut self ) -> P < ViewPath > {
5974
5974
let lo = self . span . lo ;
5975
5975
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
+
5976
5980
if self . check ( & token:: OpenDelim ( token:: Brace ) ) {
5977
5981
// use {foo,bar}
5978
5982
let idents = self . parse_unspanned_seq (
Original file line number Diff line number Diff line change
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 ( 2 u) ;
14
+ }
Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments