rollup merge of #19430: pczarn/interp_tt-cleanup
Conflicts: src/libsyntax/parse/parser.rs
This commit is contained in:
commit
0631b466c2
12 changed files with 170 additions and 103 deletions
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// error-pattern: unexpected token
|
||||
// error-pattern: unknown macro variable `nonexistent`
|
||||
|
||||
macro_rules! e {
|
||||
($inp:ident) => (
|
||||
23
src/test/compile-fail/issue-6596-2.rs
Normal file
23
src/test/compile-fail/issue-6596-2.rs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#![feature(macro_rules)]
|
||||
|
||||
// error-pattern: unknown macro variable `nonexistent`
|
||||
|
||||
macro_rules! g {
|
||||
($inp:ident) => (
|
||||
{ $inp $nonexistent }
|
||||
);
|
||||
}
|
||||
|
||||
fn main() {
|
||||
g!(foo);
|
||||
}
|
||||
|
|
@ -21,6 +21,7 @@ fn syntax_extension(cx: &ExtCtxt) {
|
|||
let _toks_1 = vec![quote_tokens!(cx, /** comment */ fn foo() {})];
|
||||
let name = quote_tokens!(cx, bar);
|
||||
let _toks_2 = vec![quote_item!(cx, static $name:int = 2;)];
|
||||
let _toks_4 = quote_tokens!(cx, $name:static $name:sizeof);
|
||||
let _toks_3 = vec![quote_item!(cx,
|
||||
/// comment
|
||||
fn foo() { let $name:int = 3; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue