]> gcc.gnu.org Git - gcc.git/blob - gcc/testsuite/rust/compile/const_generics_5.rs
resolver: Disambiguate generic args
[gcc.git] / gcc / testsuite / rust / compile / const_generics_5.rs
1 struct Foo<const N: usize = { 14 }>;
2
3 const M: usize = 15;
4 type N = Foo<3>;
5
6 fn main() {
7 let _: Foo<15> = Foo;
8 let _: Foo<{ M }> = Foo;
9 let _: Foo<M> = Foo;
10 // bogus error, but it means the above const generic gets disambiguated properly
11 let _: Foo<N> = Foo; // { dg-error "TypePath Foo<N> declares generic arguments but the type Foo{Foo {}} does not have any" }
12 }
This page took 0.035835 seconds and 5 git commands to generate.