2016-01-07 13:51:16 -05: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 16:16:27 -05:00
|
|
|
pub trait Foo<P> { fn foo() {} }
|
2016-01-07 13:51:16 -05:00
|
|
|
|
2016-01-29 16:25:18 -08:00
|
|
|
impl <P, T: Foo<P>> Foo<P> for Option<T> {}
|
2016-01-07 13:51:16 -05:00
|
|
|
|
2018-12-29 00:11:13 +01:00
|
|
|
impl<T, U> Foo<T> for Option<U> { }
|
2019-10-26 17:28:02 +02:00
|
|
|
//~^ ERROR E0119
|
2016-01-07 13:51:16 -05:00
|
|
|
|
|
|
|
fn main() {}
|