Implement use associated items of traits

This commit is contained in:
Frank King 2024-12-25 14:54:49 +08:00
parent 4e5fec2f1e
commit 5079acc060
21 changed files with 374 additions and 42 deletions

View file

@ -1183,7 +1183,11 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
let in_module_is_extern = !in_module.def_id().is_local();
in_module.for_each_child(self, |this, ident, ns, name_binding| {
// avoid non-importable candidates
if !name_binding.is_importable() {
if !name_binding.is_importable()
// FIXME(import_trait_associated_functions): remove this when `import_trait_associated_functions` is stable
|| name_binding.is_assoc_const_or_fn()
&& !this.tcx.features().import_trait_associated_functions()
{
return;
}