diff --git a/src/test/ui/const-generics/const-param-hygiene.rs b/src/test/ui/const-generics/const-param-hygiene.rs new file mode 100644 index 00000000000..c8cefc36732 --- /dev/null +++ b/src/test/ui/const-generics/const-param-hygiene.rs @@ -0,0 +1,22 @@ +// run-pass +// revisions: full min + +#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, allow(incomplete_features))] +#![cfg_attr(min, feature(min_const_generics))] + +macro_rules! bar { + ($($t:tt)*) => { impl $($t)* }; +} + +macro_rules! baz { + ($t:tt) => { fn test(&self) -> usize { $t } }; +} + +struct Foo; + +bar!(Foo { baz!{ M } }); + +fn main() { + assert_eq!(Foo::<7>.test::<3>(), 3); +}