2018-09-11 10:19:09 -05:00
|
|
|
#![feature(unsized_locals)]
|
2020-05-23 07:35:22 -05:00
|
|
|
//~^ WARN the feature `unsized_locals` is incomplete
|
2018-09-11 10:19:09 -05:00
|
|
|
|
|
|
|
pub trait Foo {
|
2020-10-16 17:37:54 -05:00
|
|
|
fn foo(self) -> String
|
|
|
|
where
|
|
|
|
Self: Sized;
|
2018-09-11 10:19:09 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
struct A;
|
|
|
|
|
|
|
|
impl Foo for A {
|
|
|
|
fn foo(self) -> String {
|
|
|
|
format!("hello")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let x = *(Box::new(A) as Box<dyn Foo>);
|
|
|
|
x.foo();
|
|
|
|
//~^ERROR the `foo` method cannot be invoked on a trait object
|
|
|
|
}
|