]> git.lizzy.rs Git - rust.git/blob - src/test/ui/coherence/coherence-impl-trait-for-trait-object-safe.rs
Merge commit 'ea199bacef07213dbe008841b89c450e3bf0c638' into rustfmt-sync
[rust.git] / src / test / ui / coherence / coherence-impl-trait-for-trait-object-safe.rs
1 // Test that we give suitable error messages when the user attempts to
2 // impl a trait `Trait` for its own object type.
3
4 // If the trait is not object-safe, we give a more tailored message
5 // because we're such schnuckels:
6 trait NotObjectSafe { fn eq(&self, other: Self); }
7 impl NotObjectSafe for dyn NotObjectSafe { }
8 //~^ ERROR E0038
9
10 fn main() { }