2016-01-07 12:51:16 -06:00
|
|
|
// Coherence error results because we do not know whether `T: Foo<P>` or not
|
|
|
|
// for the second impl.
|
|
|
|
|
|
|
|
use std::marker::PhantomData;
|
|
|
|
|
2017-02-25 15:16:27 -06:00
|
|
|
pub trait Foo<P> { fn foo() {} }
|
2016-01-07 12:51:16 -06:00
|
|
|
|
2016-01-29 18:25:18 -06:00
|
|
|
impl <P, T: Foo<P>> Foo<P> for Option<T> {}
|
2016-01-07 12:51:16 -06:00
|
|
|
|
2018-12-28 17:11:13 -06:00
|
|
|
impl<T, U> Foo<T> for Option<U> { }
|
2019-10-26 10:28:02 -05:00
|
|
|
//~^ ERROR E0119
|
2016-01-07 12:51:16 -06:00
|
|
|
|
|
|
|
fn main() {}
|