In rust-analyzer#3712, there is a bug related to lack of implementation of
local_inner_macros. I want to try to implement it , but its name resolution is so strange that I don't know how we could handle it properly :
The local_inner_macros modifier resolves all macro invocations made from within that macro as macros in the same crate. So if info! expands to an invocation of log! then this would be resolved as $crate::log! rather than requiring the caller to have log in scope.
(Copy from https://github.com/rust-lang/log/pull/288)
@matklad Any idea ?
I would say that we should store the precense of
#[local_inner_macros] on the
Hygiene struct, and use that during name resolution
I am a little bit lost here. does
Hygiene struct belong to call-site, not def-site ?
Hygiene kinda both; At the moment it stores the
def_crate, which is exactly what is needed for local inner macros