rust/tests/auxiliary/test_macro.rs
Philipp Hansch 5d36edc90d
Prevent crash when macro is in different file
This was caused by a macro in a different file.
The `target.span` was be in the file of the macro definition and the
`item.span` in the file of the calling code.
2018-05-01 18:46:15 +02:00

12 lines
379 B
Rust

pub trait A {}
macro_rules! __implicit_hasher_test_macro {
(impl< $($impl_arg:tt),* > for $kind:ty where $($bounds:tt)*) => {
__implicit_hasher_test_macro!( ($($impl_arg),*) ($kind) ($($bounds)*) );
};
(($($impl_arg:tt)*) ($($kind_arg:tt)*) ($($bounds:tt)*)) => {
impl< $($impl_arg)* > test_macro::A for $($kind_arg)* where $($bounds)* { }
};
}