mirror of https://github.com/rust-lang/rust
18 lines
310 B
Rust
18 lines
310 B
Rust
#![feature(type_alias_impl_trait)]
|
|
|
|
trait Bar {
|
|
fn bar(&self);
|
|
}
|
|
|
|
type FooFn<B> = impl FnOnce();
|
|
|
|
fn foo<B: Bar>(bar: B) -> FooFn<B> {
|
|
move || { bar.bar() }
|
|
//~^ ERROR the trait bound `B: Bar` is not satisfied
|
|
}
|
|
|
|
fn main() {
|
|
let boom: FooFn<u32> = unsafe { core::mem::zeroed() };
|
|
boom();
|
|
}
|