going through the docs I found TypeckResults::qpath_res(&self, qpath: &QPath<'_>, id: HirId) .
I think that I want something like that. Not sure which qpath and id should I pass.
I tried dbg!(tcx.typeck(segment.hir_id.owner.def_id).qpath_res(qpath, segment.hir_id));
With:
-
qpath= theTypeRelativeqpath that I want to resolve. -
hir_id= the hirA::new()(I guess that the issue is here and is the local_id (*))
But something is wrong cause I get an Err. Btw I feel like I'm in the right direction cause I can see that TypeckResults have the right path for A::new().
(*) seems that local_id in segment.hir_id is different from the one in the TypeRelative maps. But they both are local respect to the same Item cause TypeRelative.hir_owner is the function that call A::new() , and I'm pretty sure that segment.hir_id.local_id refer the the function that call A::new().
I'm saying that cause the only way to change segment.hir_id.local_id is changing that function.
Specifically I always get segment.hir_id.loca_id = local_id_in_the_type_relative_map + 3