mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 07:44:10 +00:00
25 lines
347 B
Rust
25 lines
347 B
Rust
struct A<T>(T);
|
|
struct B;
|
|
|
|
trait I<T> {}
|
|
impl I<i32> for B {}
|
|
impl I<u32> for B {}
|
|
|
|
trait V<U> {
|
|
fn method(self) -> U;
|
|
}
|
|
|
|
impl<T, U> V<U> for A<T>
|
|
where
|
|
T: I<U>,
|
|
{
|
|
fn method(self) -> U { unimplemented!() }
|
|
}
|
|
|
|
fn main() {
|
|
let a = A(B);
|
|
a.method();
|
|
//~^ ERROR type annotations needed
|
|
//~| ERROR type annotations needed
|
|
}
|