]> git.lizzy.rs Git - rust.git/blob - src/test/ui/coherence/coherence-unsafe-trait-object-impl.rs
Merge commit 'ea199bacef07213dbe008841b89c450e3bf0c638' into rustfmt-sync
[rust.git] / src / test / ui / coherence / coherence-unsafe-trait-object-impl.rs
1 // Check that unsafe trait object do not implement themselves
2 // automatically
3
4 #![feature(object_safe_for_dispatch)]
5
6 trait Trait: Sized {
7     fn call(&self);
8 }
9
10 fn takes_t<S: Trait>(s: S) {
11     s.call();
12 }
13
14 fn takes_t_obj(t: &dyn Trait) {
15     takes_t(t); //~ ERROR E0277
16 }
17
18 fn main() {}