]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/const-param-hygiene.rs
Rollup merge of #87742 - npmccallum:naked_ffi, r=Amanieu
[rust.git] / src / test / ui / const-generics / const-param-hygiene.rs
1 // run-pass
2 // revisions: full min
3
4 #![cfg_attr(full, feature(const_generics))]
5 #![cfg_attr(full, allow(incomplete_features))]
6
7 macro_rules! bar {
8     ($($t:tt)*) => { impl<const N: usize> $($t)* };
9 }
10
11 macro_rules! baz {
12     ($t:tt) => { fn test<const M: usize>(&self) -> usize { $t } };
13 }
14
15 struct Foo<const N: usize>;
16
17 bar!(Foo<N> { baz!{ M } });
18
19 fn main() {
20     assert_eq!(Foo::<7>.test::<3>(), 3);
21 }