2018-05-22 12:09:35 -03:00
|
|
|
trait Trait {}
|
|
|
|
|
|
|
|
|
|
trait X {
|
2024-04-23 14:52:54 -04:00
|
|
|
fn foo(&self) where Self: Trait;
|
2018-05-22 12:09:35 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl X for () {
|
|
|
|
|
fn foo(&self) {}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl Trait for dyn X {}
|
2024-11-20 14:19:36 -08:00
|
|
|
//~^ ERROR the trait `X` is not dyn compatible
|
2018-05-22 12:09:35 -03:00
|
|
|
|
|
|
|
|
pub fn main() {
|
|
|
|
|
// Check that this does not segfault.
|
2019-05-28 14:46:13 -04:00
|
|
|
<dyn X as X>::foo(&());
|
2024-11-20 14:19:36 -08:00
|
|
|
//~^ ERROR the trait `X` is not dyn compatible
|
|
|
|
|
//~| ERROR the trait `X` is not dyn compatible
|
2018-05-22 12:09:35 -03:00
|
|
|
}
|