2018-04-20 10:41:31 -05:00
|
|
|
#![feature(try_from)]
|
|
|
|
|
2017-10-22 10:14:53 -05:00
|
|
|
use std::marker::PhantomData;
|
|
|
|
use std::convert::{TryFrom, AsRef};
|
|
|
|
|
|
|
|
struct Q;
|
2017-11-20 06:13:27 -06:00
|
|
|
impl AsRef<Q> for Box<Q> { //~ ERROR conflicting implementations
|
2017-10-22 10:14:53 -05:00
|
|
|
fn as_ref(&self) -> &Q {
|
|
|
|
&**self
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
struct S;
|
2017-11-20 06:13:27 -06:00
|
|
|
impl From<S> for S { //~ ERROR conflicting implementations
|
2017-10-22 10:14:53 -05:00
|
|
|
fn from(s: S) -> S {
|
|
|
|
s
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
struct X;
|
2017-11-20 06:13:27 -06:00
|
|
|
impl TryFrom<X> for X { //~ ERROR conflicting implementations
|
2017-10-22 10:14:53 -05:00
|
|
|
type Error = ();
|
|
|
|
fn try_from(u: X) -> Result<X, ()> {
|
|
|
|
Ok(u)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-20 06:13:27 -06:00
|
|
|
fn main() {}
|