Introduce ModernIdent type to unify macro 2.0 hygiene handling

Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
This commit is contained in:
xizheyin
2025-08-06 21:19:09 +08:00
parent dc0bae1db7
commit 6e7b9d5149
9 changed files with 97 additions and 44 deletions

View File

@@ -536,11 +536,11 @@ impl<'ra, 'tcx> ResolverExpand for Resolver<'ra, 'tcx> {
target_trait.for_each_child(self, |this, ident, ns, _binding| {
// FIXME: Adjust hygiene for idents from globs, like for glob imports.
if let Some(overriding_keys) = this.impl_binding_keys.get(&impl_def_id)
&& overriding_keys.contains(&BindingKey::new(ident, ns))
&& overriding_keys.contains(&BindingKey::new(ident.0, ns))
{
// The name is overridden, do not produce it from the glob delegation.
} else {
idents.push((ident, None));
idents.push((ident.0, None));
}
});
Ok(idents)