2025-01-09 17:32:29 +00:00
|
|
|
// Sets some arbitrarily large width for more consistent output (see #135288).
|
|
|
|
|
//@ compile-flags: --diagnostic-width=120
|
2022-08-29 16:53:36 +03:00
|
|
|
struct Argument;
|
|
|
|
|
struct Return;
|
|
|
|
|
|
|
|
|
|
fn function(_: Argument) -> Return { todo!() }
|
|
|
|
|
|
|
|
|
|
trait Trait {}
|
|
|
|
|
impl Trait for fn(Argument) -> Return {}
|
|
|
|
|
|
|
|
|
|
fn takes(_: impl Trait) {}
|
|
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
|
takes(function);
|
|
|
|
|
//~^ ERROR the trait bound
|
|
|
|
|
takes(|_: Argument| -> Return { todo!() });
|
|
|
|
|
//~^ ERROR the trait bound
|
|
|
|
|
}
|