mirror of
https://gcc.gnu.org/git/gcc.git
synced 2026-02-22 20:01:22 -05:00
gccrs: const generics: Make sure const generic types are visited properly
...in all contexts. gcc/testsuite/ChangeLog: * rust/compile/const_generics_7.rs: New test.
This commit is contained in:
17
gcc/testsuite/rust/compile/const_generics_7.rs
Normal file
17
gcc/testsuite/rust/compile/const_generics_7.rs
Normal file
@@ -0,0 +1,17 @@
|
||||
struct S<const N: usize>;
|
||||
|
||||
pub fn foo<const N: FooBar>() {} // { dg-error "failed to resolve" }
|
||||
type Foo<const N: FooBar> = S<N>; // { dg-error "failed to resolve" }
|
||||
struct Foo2<const N: FooBar>; // { dg-error "failed to resolve" }
|
||||
enum Foo3<const N: FooBar> { // { dg-error "failed to resolve" }
|
||||
Foo,
|
||||
Bar,
|
||||
}
|
||||
union Foo4<const N: FooBar> { // { dg-error "failed to resolve" }
|
||||
a: usize,
|
||||
b: i32,
|
||||
}
|
||||
trait Fooable<const N: FooBar> {} // { dg-error "failed to resolve" }
|
||||
|
||||
trait Traitable {}
|
||||
impl<const N: FooBar> Traitable for Foo2<N> {} // { dg-error "failed to resolve" }
|
||||
Reference in New Issue
Block a user