mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
21 lines
248 B
Rust
21 lines
248 B
Rust
//@ 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
|
|
let closure = || S;
|
|
bar(closure); //~ERROR E0277
|
|
}
|