diff options
author | Arthur Cohen <arthur.cohen@embecosm.com> | 2022-09-12 15:53:01 +0200 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2022-09-12 15:53:01 +0200 |
commit | 5a019b1e71affaf474e2878e51fcc5c7d1068d5b (patch) | |
tree | ed608d16d8ed59f9b22a8c0ee4fca7e9e13bdd64 | |
parent | f252b4093666cf1e3d948b22f00fc12bf283a83f (diff) | |
download | gcc-5a019b1e71affaf474e2878e51fcc5c7d1068d5b.zip gcc-5a019b1e71affaf474e2878e51fcc5c7d1068d5b.tar.gz gcc-5a019b1e71affaf474e2878e51fcc5c7d1068d5b.tar.bz2 |
const generics: Make sure const generic types are visited properly in
all contexts
-rw-r--r-- | gcc/testsuite/rust/compile/const_generics_7.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/rust/compile/const_generics_7.rs b/gcc/testsuite/rust/compile/const_generics_7.rs new file mode 100644 index 0000000..2c128db --- /dev/null +++ b/gcc/testsuite/rust/compile/const_generics_7.rs @@ -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" } |