mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-30 14:01:51 +00:00
14 lines
222 B
Rust
14 lines
222 B
Rust
trait Foo {}
|
|
|
|
impl Foo for i32 {}
|
|
|
|
fn needs_foo(_: impl Foo) {}
|
|
|
|
fn test(x: &Box<dyn Fn() -> i32>) {
|
|
needs_foo(x);
|
|
//~^ ERROR the trait bound
|
|
//~| HELP use parentheses to call this trait object
|
|
}
|
|
|
|
fn main() {}
|