diff options
| author | Jeffrey Seyfried <jeffrey.seyfried@gmail.com> | 2017-01-29 08:38:44 +0000 |
|---|---|---|
| committer | Jeffrey Seyfried <jeffrey.seyfried@gmail.com> | 2017-02-28 22:14:29 +0000 |
| commit | d8b34e9a74a4e91c4283ba4002a050ac0150cec6 (patch) | |
| tree | fc62b9e970fd9120e078856dd6c9727bcb55ac89 /src/test/compile-fail | |
| parent | 247188803356234ae5d6ecf947ffb2308688dc90 (diff) | |
| download | rust-d8b34e9a74a4e91c4283ba4002a050ac0150cec6.tar.gz rust-d8b34e9a74a4e91c4283ba4002a050ac0150cec6.zip | |
Add `syntax::ext::tt::quoted::{TokenTree, ..}` and remove `tokenstream::TokenTree::Sequence`.
Diffstat (limited to 'src/test/compile-fail')
| -rw-r--r-- | src/test/compile-fail/issue-35450.rs | 5 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-39709.rs | 15 | ||||
| -rw-r--r-- | src/test/compile-fail/macro-error.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/macro-match-nonterminal.rs | 3 | ||||
| -rw-r--r-- | src/test/compile-fail/macro-tt-matchers.rs | 13 | ||||
| -rw-r--r-- | src/test/compile-fail/malformed_macro_lhs.rs | 2 |
6 files changed, 7 insertions, 33 deletions
diff --git a/src/test/compile-fail/issue-35450.rs b/src/test/compile-fail/issue-35450.rs index d890d02a910..5f54f269c6c 100644 --- a/src/test/compile-fail/issue-35450.rs +++ b/src/test/compile-fail/issue-35450.rs @@ -8,9 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -macro_rules! m { ($t:tt) => { $t } } +macro_rules! m { ($($t:tt)*) => { $($t)* } } fn main() { - m!($t); //~ ERROR unknown macro variable - //~| ERROR expected expression + m!($t); //~ ERROR expected expression } diff --git a/src/test/compile-fail/issue-39709.rs b/src/test/compile-fail/issue-39709.rs deleted file mode 100644 index 0f66fe84393..00000000000 --- a/src/test/compile-fail/issue-39709.rs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2017 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. - -fn main() { - println!("{}", { macro_rules! x { ($()*) => {} } 33 }); - //~^ ERROR no syntax variables matched as repeating at this depth -} - diff --git a/src/test/compile-fail/macro-error.rs b/src/test/compile-fail/macro-error.rs index 78f95e365c4..82a5aa48729 100644 --- a/src/test/compile-fail/macro-error.rs +++ b/src/test/compile-fail/macro-error.rs @@ -9,7 +9,7 @@ // except according to those terms. macro_rules! foo { - ($a:expr) => $a; //~ ERROR macro rhs must be delimited + ($a:expr) => a; //~ ERROR macro rhs must be delimited } fn main() { diff --git a/src/test/compile-fail/macro-match-nonterminal.rs b/src/test/compile-fail/macro-match-nonterminal.rs index 6cca729e2c2..0af171b43fe 100644 --- a/src/test/compile-fail/macro-match-nonterminal.rs +++ b/src/test/compile-fail/macro-match-nonterminal.rs @@ -8,7 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -macro_rules! test { ($a, $b) => (()); } //~ ERROR missing fragment +macro_rules! test { ($a, //~ ERROR missing fragment + $b) => (()); } //~ ERROR missing fragment fn main() { test!() diff --git a/src/test/compile-fail/macro-tt-matchers.rs b/src/test/compile-fail/macro-tt-matchers.rs index 969f1500717..7255e7d00b6 100644 --- a/src/test/compile-fail/macro-tt-matchers.rs +++ b/src/test/compile-fail/macro-tt-matchers.rs @@ -17,16 +17,5 @@ macro_rules! foo { foo!(Box); -macro_rules! bar { - ($x:tt) => { - macro_rules! baz { - ($x:tt, $y:tt) => { ($x, $y) } - } - } -} - #[rustc_error] -fn main() { //~ ERROR compilation successful - bar!($y); - let _: (i8, i16) = baz!(0i8, 0i16); -} +fn main() {} //~ ERROR compilation successful diff --git a/src/test/compile-fail/malformed_macro_lhs.rs b/src/test/compile-fail/malformed_macro_lhs.rs index 5d81e21f056..0b437be5393 100644 --- a/src/test/compile-fail/malformed_macro_lhs.rs +++ b/src/test/compile-fail/malformed_macro_lhs.rs @@ -9,7 +9,7 @@ // except according to those terms. macro_rules! my_precioooous { - $($t:tt)* => (1); //~ ERROR invalid macro matcher + t => (1); //~ ERROR invalid macro matcher } fn main() { |
