Open
Description
The following code has different behaviour depending on whether the associated function is called directly or through a method call. For example:
trait X {
type G;
fn make_g() -> Self::G;
}
impl<'a> X for fn(&'a ()) {
type G = &'a ();
fn make_g() -> Self::G {
&()
}
}
fn indirect<T: X>() {
let x = T::make_g();
}
fn call_indirect() {
indirect::<fn(&())>(); // OK
}
fn direct() {
let x = <fn(&())>::make_g(); //~ ERROR
}