rust/tests/ui/const-generics/early/const-param-hygiene.rs

18 lines
289 B
Rust
Raw Normal View History

2020-11-10 02:29:27 -06:00
// run-pass
macro_rules! bar {
($($t:tt)*) => { impl<const N: usize> $($t)* };
}
macro_rules! baz {
($t:tt) => { fn test<const M: usize>(&self) -> usize { $t } };
}
struct Foo<const N: usize>;
bar!(Foo<N> { baz!{ M } });
fn main() {
assert_eq!(Foo::<7>.test::<3>(), 3);
}