mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
17 lines
319 B
Rust
17 lines
319 B
Rust
|
trait Foo {
|
||
|
const ASSOC: bool = true;
|
||
|
}
|
||
|
impl<T> Foo for fn(T) {}
|
||
|
|
||
|
fn foo(_x: i32) {}
|
||
|
|
||
|
fn impls_foo<T: Foo>(_x: T) {}
|
||
|
|
||
|
fn main() {
|
||
|
impls_foo(foo as fn(i32));
|
||
|
|
||
|
<fn(&u8) as Foo>::ASSOC;
|
||
|
//~^ ERROR implementation of `Foo` is not general enough
|
||
|
//~| ERROR implementation of `Foo` is not general enough
|
||
|
}
|