2019-08-24 16:45:03 -05:00
|
|
|
// edition:2018
|
|
|
|
trait T {
|
|
|
|
type O;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct S;
|
|
|
|
|
|
|
|
impl T for S {
|
|
|
|
type O = ();
|
|
|
|
}
|
|
|
|
|
|
|
|
fn foo() -> impl T<O=()> { S }
|
|
|
|
|
|
|
|
fn bar(f: impl T<O=()>) {}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
bar(foo); //~ERROR E0277
|
2019-11-08 20:04:05 -06:00
|
|
|
let closure = || S;
|
|
|
|
bar(closure); //~ERROR E0277
|
2019-08-24 16:45:03 -05:00
|
|
|
}
|