2019-01-08 22:14:04 +01:00
|
|
|
// Check that unsafe trait object do not implement themselves
|
|
|
|
// automatically
|
|
|
|
|
2024-10-09 18:37:30 +02:00
|
|
|
#![feature(dyn_compatible_for_dispatch)]
|
2019-01-08 22:14:04 +01:00
|
|
|
|
|
|
|
trait Trait: Sized {
|
|
|
|
fn call(&self);
|
|
|
|
}
|
|
|
|
|
|
|
|
fn takes_t<S: Trait>(s: S) {
|
|
|
|
s.call();
|
|
|
|
}
|
|
|
|
|
|
|
|
fn takes_t_obj(t: &dyn Trait) {
|
|
|
|
takes_t(t); //~ ERROR E0277
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|