Closed
Description
in
we disable hidden type registration. I have been unable to craft a test case for this, as either theself_ty
arg of instantiate_value_path
is None
, or there are no generic parameters on the self type, so it gets inference variables which end up working out fine.
As an example:
#![feature(type_alias_impl_trait)]
struct Foo<T>(T);
impl Foo<u32> {
fn method() {}
fn method2(self) {}
}
type Bar = impl Sized;
fn bar() -> Bar {
42_u32
}
impl Foo<Bar> {
fn foo() -> Bar {
Self::method();
//~^ ERROR: no function or associated item named `method` found for struct `Foo<Bar>`
Foo::<Bar>::method();
//~^ ERROR: no function or associated item named `method` found for struct `Foo<Bar>`
let x = Foo(bar());
Foo::method2(x);
let x = Self(bar());
Self::method2(x);
//~^ ERROR: no function or associated item named `method2` found for struct `Foo<Bar>`
todo!()
}
}
fn main() {}
the Foo::method2(x);
works fine, none of the others do, and none of them have a self_ty
set here either.
Wrapping the types in <>
does not have an effect, even if the code seems to hint at that:
any ideas @compiler-errors
cc #121394