rust/tests/ui/suggestions/call-on-unimplemented-fn-ptr.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
266 B
Rust
Raw Normal View History

struct Foo;
trait Bar {}
impl Bar for Foo {}
fn needs_bar<T: Bar>(_: T) {}
fn blah(f: fn() -> Foo) {
needs_bar(f);
//~^ ERROR the trait bound `fn() -> Foo: Bar` is not satisfied
//~| HELP use parentheses to call this function pointer
}
fn main() {}