summaryrefslogtreecommitdiffstats
path: root/src/test/ui/coherence/coherence-unsafe-trait-object-impl.rs
blob: 9859a226efd0074b24491988e808cc48d8c46916 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Check that unsafe trait object do not implement themselves
// automatically

#![feature(object_safe_for_dispatch)]

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() {}