mirror of
https://github.com/rust-lang/rust.git
synced 2025-11-24 05:27:11 +00:00
This handles various kinds of errors, but does not allow applying the derive yet. This adds the feature gate `macro_derive`.
33 lines
1017 B
Rust
33 lines
1017 B
Rust
#![crate_type = "lib"]
|
|
#![feature(macro_attr)]
|
|
|
|
macro_rules! attr_incomplete_1 { attr }
|
|
//~^ ERROR macro definition ended unexpectedly
|
|
|
|
macro_rules! attr_incomplete_2 { attr() }
|
|
//~^ ERROR macro definition ended unexpectedly
|
|
|
|
macro_rules! attr_incomplete_3 { attr() {} }
|
|
//~^ ERROR expected `=>`
|
|
|
|
macro_rules! attr_incomplete_4 { attr() {} => }
|
|
//~^ ERROR macro definition ended unexpectedly
|
|
|
|
macro_rules! attr_noparens_1 { attr{} {} => {} }
|
|
//~^ ERROR `attr` rule argument matchers require parentheses
|
|
|
|
macro_rules! attr_noparens_2 { attr[] {} => {} }
|
|
//~^ ERROR `attr` rule argument matchers require parentheses
|
|
|
|
macro_rules! attr_noparens_3 { attr _ {} => {} }
|
|
//~^ ERROR invalid macro matcher
|
|
|
|
macro_rules! attr_dup_matcher_1 { attr() {$x:ident $x:ident} => {} }
|
|
//~^ ERROR duplicate matcher binding
|
|
|
|
macro_rules! attr_dup_matcher_2 { attr($x:ident $x:ident) {} => {} }
|
|
//~^ ERROR duplicate matcher binding
|
|
|
|
macro_rules! attr_dup_matcher_3 { attr($x:ident) {$x:ident} => {} }
|
|
//~^ ERROR duplicate matcher binding
|