]> git.proxmox.com Git - rustc.git/blame - src/test/ui/coherence/coherence-impl-trait-for-trait-object-safe.rs
New upstream version 1.41.1+dfsg1
[rustc.git] / src / test / ui / coherence / coherence-impl-trait-for-trait-object-safe.rs
CommitLineData
e9174d1e
SL
1// Test that we give suitable error messages when the user attempts to
2// impl a trait `Trait` for its own object type.
85aaf69f 3
e9174d1e
SL
4// If the trait is not object-safe, we give a more tailored message
5// because we're such schnuckels:
6trait NotObjectSafe { fn eq(&self, other: Self); }
dc9dc135 7impl NotObjectSafe for dyn NotObjectSafe { }
60c5eb7d 8//~^ ERROR E0038
223e47cc 9
e9174d1e 10fn main() { }