Add failing variation of _0 span test

This commit is contained in:
David Tolnay 2020-05-15 16:33:14 -07:00
parent 3891d985fb
commit 57b4e9218f
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
1 changed files with 9 additions and 2 deletions

View File

@ -206,14 +206,21 @@ fn test_macro_rules() {
macro_rules! decl_error { macro_rules! decl_error {
($variant:ident($value:ident)) => { ($variant:ident($value:ident)) => {
#[derive(Debug, Error)] #[derive(Debug, Error)]
pub enum Error { pub enum Error0 {
#[error("{0:?}")] #[error("{0:?}")]
$variant($value), $variant($value),
} }
#[derive(Debug, Error)]
#[error("{0:?}")]
pub enum Error1 {
$variant($value),
}
}; };
} }
decl_error!(Repro(u8)); decl_error!(Repro(u8));
assert("0", Error::Repro(0)); assert("0", Error0::Repro(0));
assert("0", Error1::Repro(0));
} }