diff options
Diffstat (limited to 'src/test/ui/const-generics/defaults/type-default-const-param-name.rs')
-rw-r--r-- | src/test/ui/const-generics/defaults/type-default-const-param-name.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/ui/const-generics/defaults/type-default-const-param-name.rs b/src/test/ui/const-generics/defaults/type-default-const-param-name.rs new file mode 100644 index 000000000..405664ded --- /dev/null +++ b/src/test/ui/const-generics/defaults/type-default-const-param-name.rs @@ -0,0 +1,14 @@ +// check-pass +struct N; + +struct Foo<const N: usize = 1, T = N>(T); + +impl Foo { + fn new() -> Self { + Foo(N) + } +} + +fn main() { + let Foo::<1, N>(N) = Foo::new(); +} |