in
we disable hidden type registration. I have been unable to craft a test case for this, as either the
self_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:
|
// `<T>::assoc` will end up here, and so |
any ideas @compiler-errors
cc #121394
in
rust/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs
Line 1452 in 1d447a9
self_tyarg ofinstantiate_value_pathisNone, or there are no generic parameters on the self type, so it gets inference variables which end up working out fine.As an example:
the
Foo::method2(x);works fine, none of the others do, and none of them have aself_tyset here either.Wrapping the types in
<>does not have an effect, even if the code seems to hint at that:rust/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs
Line 1150 in 1d447a9
any ideas @compiler-errors
cc #121394