]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/associated-type-bounds/assoc-type-eq-with-dyn-atb-fail.rs
1 // This test documents that `type Out = Box<dyn Bar<Assoc: Copy>>;`
2 // is allowed and will correctly reject an opaque `type Out` which
3 // does not satisfy the bound `<TheType as Bar>::Assoc: Copy`.
5 // FIXME(rust-lang/lang): I think this behavior is logical if we want to allow
6 // `dyn Trait<Assoc: Bound>` but we should decide if we want that. // Centril
8 // Additionally, as reported in https://github.com/rust-lang/rust/issues/63594,
9 // we check that the spans for the error message are sane here.
11 #![feature(associated_type_bounds)]
21 fn func() -> Self::Out
;
25 impl Bar
for AssocNoCopy
{
29 impl Thing
for AssocNoCopy
{
30 type Out
= Box
<dyn Bar
<Assoc
: Copy
>>;
32 fn func() -> Self::Out
{
33 //~^ ERROR the trait bound `String: Copy` is not satisfied