mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-30 14:01:51 +00:00
36 lines
701 B
Rust
36 lines
701 B
Rust
use std::convert::TryInto;
|
|
|
|
trait A<T> {
|
|
fn foo() {}
|
|
}
|
|
|
|
trait B<T, U> {
|
|
fn bar() {}
|
|
}
|
|
|
|
struct S;
|
|
|
|
impl<T> A<T> for S {}
|
|
impl<T, U> B<T, U> for S {}
|
|
|
|
fn main() {
|
|
let _ = A::foo::<S>();
|
|
//~^ ERROR
|
|
//~| HELP remove the unnecessary generics
|
|
//~| HELP consider moving this generic argument
|
|
|
|
let _ = B::bar::<S, S>();
|
|
//~^ ERROR
|
|
//~| HELP remove the unnecessary generics
|
|
//~| HELP consider moving these generic arguments
|
|
|
|
let _ = A::<S>::foo::<S>();
|
|
//~^ ERROR
|
|
//~| HELP remove the unnecessary generics
|
|
|
|
let _ = 42.into::<Option<_>>();
|
|
//~^ ERROR
|
|
//~| HELP remove the unnecessary generics
|
|
//~| HELP consider moving this generic argument
|
|
}
|