summaryrefslogtreecommitdiffstats
path: root/src/test/ui/const-generics/early/const-param-hygiene.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/const-generics/early/const-param-hygiene.rs')
-rw-r--r--src/test/ui/const-generics/early/const-param-hygiene.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/ui/const-generics/early/const-param-hygiene.rs b/src/test/ui/const-generics/early/const-param-hygiene.rs
new file mode 100644
index 000000000..fd4e5b409
--- /dev/null
+++ b/src/test/ui/const-generics/early/const-param-hygiene.rs
@@ -0,0 +1,17 @@
+// 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);
+}