]> git.proxmox.com Git - rustc.git/blame - src/test/ui/e0119/conflict-with-std.rs
New upstream version 1.34.2+dfsg1
[rustc.git] / src / test / ui / e0119 / conflict-with-std.rs
CommitLineData
85aaf69f 1
abe05a73
XL
2use std::marker::PhantomData;
3use std::convert::{TryFrom, AsRef};
223e47cc 4
abe05a73 5struct Q;
ff7c6d11 6impl AsRef<Q> for Box<Q> { //~ ERROR conflicting implementations
abe05a73
XL
7 fn as_ref(&self) -> &Q {
8 &**self
9 }
ea8adc8c 10}
abe05a73
XL
11
12struct S;
ff7c6d11 13impl From<S> for S { //~ ERROR conflicting implementations
abe05a73
XL
14 fn from(s: S) -> S {
15 s
16 }
17}
18
19struct X;
ff7c6d11 20impl TryFrom<X> for X { //~ ERROR conflicting implementations
abe05a73
XL
21 type Error = ();
22 fn try_from(u: X) -> Result<X, ()> {
23 Ok(u)
24 }
25}
26
ff7c6d11 27fn main() {}