File tree Expand file tree Collapse file tree 2 files changed +44
-2
lines changed Expand file tree Collapse file tree 2 files changed +44
-2
lines changed Original file line number Diff line number Diff line change @@ -192,8 +192,7 @@ pub mod rt {
192192
193193 impl ToTokens for ast:: Lifetime {
194194 fn to_tokens ( & self , _cx : & ExtCtxt ) -> Vec < TokenTree > {
195- let lifetime_ident = ast:: Ident :: with_empty_ctxt ( self . name ) ;
196- vec ! [ TokenTree :: Token ( DUMMY_SP , token:: Lifetime ( lifetime_ident) ) ]
195+ vec ! [ TokenTree :: Token ( DUMMY_SP , token:: Lifetime ( self . ident) ) ]
197196 }
198197 }
199198
Original file line number Diff line number Diff line change 1+ // Copyright 2012 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+ #![ allow( unreachable_code) ]
12+
13+ macro_rules! x {
14+ ( $a: lifetime) => {
15+ $a: loop {
16+ break $a;
17+ panic!( "failed" ) ;
18+ }
19+ }
20+ }
21+ macro_rules! br {
22+ ( $a: lifetime) => {
23+ break $a;
24+ }
25+ }
26+ macro_rules! br2 {
27+ ( $b: lifetime) => {
28+ ' b: loop {
29+ break $b; // this $b should refer to the outer loop.
30+ }
31+ }
32+ }
33+ fn main ( ) {
34+ x ! ( ' a) ;
35+ ' c: loop {
36+ br ! ( ' c) ;
37+ panic ! ( "failed" ) ;
38+ }
39+ ' b: loop {
40+ br2 ! ( ' b) ;
41+ panic ! ( "failed" ) ;
42+ }
43+ }
You can’t perform that action at this time.
0 commit comments