Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 9b4fb90

Browse files
committed
Test macros
1 parent c2f6770 commit 9b4fb90

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
error: `$t:ty` is followed by `is`, which is not allowed for `ty` fragments
2+
--> $DIR/macros.rs:10:12
3+
|
4+
LL | ($t:ty is $p:pat) => {};
5+
| ^^ not allowed after `ty` fragments
6+
|
7+
= note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where`
8+
9+
error: aborting due to 1 previous error
10+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
error: `$t:ty` is followed by `is`, which is not allowed for `ty` fragments
2+
--> $DIR/macros.rs:10:12
3+
|
4+
LL | ($t:ty is $p:pat) => {};
5+
| ^^ not allowed after `ty` fragments
6+
|
7+
= note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where`
8+
9+
error: aborting due to 1 previous error
10+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// revisions: gated active
2+
3+
#![cfg_attr(active, feature(pattern_types))]
4+
#![allow(incomplete_features)]
5+
6+
// Check that pattern types do not affect existing macros.
7+
// They don't, because `is` was never legal after `ty` fragments.
8+
9+
macro_rules! foo {
10+
($t:ty is $p:pat) => {}; //~ ERROR `$t:ty` is followed by `is`, which is not allowed for `ty` fragments
11+
}
12+
13+
fn main() {
14+
foo!(u32 is 1..)
15+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /