]> git.proxmox.com Git - rustc.git/blame - src/test/ui/impl-trait/nested-return-type2-tait2.rs
Update unsuspicious file list
[rustc.git] / src / test / ui / impl-trait / nested-return-type2-tait2.rs
CommitLineData
ee023bcb
FG
1#![feature(type_alias_impl_trait)]
2
3trait Duh {}
4
5impl Duh for i32 {}
6
7trait Trait {
8 type Assoc: Duh;
9}
10
11// the fact that `R` is the `::Output` projection on `F` causes
12// an intermediate inference var to be generated which is then later
13// compared against the actually found `Assoc` type.
14impl<R: Duh, F: FnMut() -> R> Trait for F {
15 type Assoc = R;
16}
17
18type Sendable = impl Send;
19type Traitable = impl Trait<Assoc = Sendable>;
20
21// The `impl Send` here is then later compared against the inference var
22// created, causing the inference var to be set to `impl Send` instead of
23// the hidden type. We already have obligations registered on the inference
24// var to make it uphold the `: Duh` bound on `Trait::Assoc`. The opaque
25// type does not implement `Duh`, even if its hidden type does. So we error out.
26fn foo() -> Traitable {
27 || 42
28 //~^ ERROR `Sendable: Duh` is not satisfied
29}
30
31fn main() {
32}