Files
rust/tests/ui/methods/receiver-equality.rs
2026-03-28 16:18:11 +09:00

17 lines
341 B
Rust

// Tests that we probe receivers invariantly when using path-based method lookup.
struct B<T>(T);
impl B<fn(&'static ())> {
fn method(self) {
println!("hey");
}
}
fn foo(y: B<fn(&'static ())>) {
B::<for<'a> fn(&'a ())>::method(y);
//~^ ERROR no associated function or constant named `method` found
}
fn main() {}