rust/tests/ui/impl-trait/in-trait/generics-mismatch.rs
2023-10-13 21:01:36 +00:00

17 lines
259 B
Rust

#![allow(incomplete_features)]
struct U;
trait Foo {
fn bar(&self) -> impl Sized;
}
impl Foo for U {
fn bar<T>(&self) {}
//~^ ERROR method `bar` has 1 type parameter but its trait declaration has 0 type parameters
}
fn main() {
U.bar();
}