mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +00:00
25 lines
533 B
Rust
25 lines
533 B
Rust
#![feature(non_lifetime_binders)]
|
|
//~^ WARN the feature `non_lifetime_binders` is incomplete
|
|
|
|
trait Foo: for<T> Bar<T> {}
|
|
|
|
trait Bar<T: ?Sized> {
|
|
fn method(&self) {}
|
|
}
|
|
|
|
fn needs_bar(x: &(impl Bar<i32> + ?Sized)) {
|
|
x.method();
|
|
}
|
|
|
|
impl Foo for () {}
|
|
|
|
impl<T: ?Sized> Bar<T> for () {}
|
|
|
|
fn main() {
|
|
let x: &dyn Foo = &();
|
|
//~^ ERROR the trait `Foo` cannot be made into an object
|
|
//~| ERROR the trait `Foo` cannot be made into an object
|
|
needs_bar(x);
|
|
//~^ ERROR the trait `Foo` cannot be made into an object
|
|
}
|