mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 09:14:20 +00:00
14 lines
279 B
Rust
14 lines
279 B
Rust
// Coherence error results because we do not know whether `T: Foo<P>` or not
|
|
// for the second impl.
|
|
|
|
use std::marker::PhantomData;
|
|
|
|
pub trait Foo<P> { fn foo() {} }
|
|
|
|
impl <P, T: Foo<P>> Foo<P> for Option<T> {}
|
|
|
|
impl<T, U> Foo<T> for Option<U> { }
|
|
//~^ ERROR E0119
|
|
|
|
fn main() {}
|