diff options
Diffstat (limited to 'gcc/testsuite/rust/compile/issue-2369.rs')
-rw-r--r-- | gcc/testsuite/rust/compile/issue-2369.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/rust/compile/issue-2369.rs b/gcc/testsuite/rust/compile/issue-2369.rs new file mode 100644 index 0000000..9475aef --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-2369.rs @@ -0,0 +1,21 @@ +#[lang = "sized"] +trait Sized {} + +fn main() { + pub trait Foo { + type A; + fn boo(&self) -> <Self as Foo>::A; + } + + struct Bar; + + impl Foo for isize { + type A = usize; + fn boo(&self) -> usize { + 42 + } + } + + fn baz<I>(x: &<I as Foo<A = Bar>>::A) {} + // { dg-error "associated type bindings are not allowed here .E0229." "" { target *-*-* } .-1 } +} |