You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
hygiene: cannot find macro foo! in this scope #63685
This is a regression from #63114 (cc @matthewjasper).
Slightly more minimized reproduction will look like this:
macro_rules! foo {() => {"foo"};}macro_rules! bar {() => {
foo!()};}fnmain(){format_args!(bar!());// ERROR, `foo` is not found, happens because `format_args` is opaque now}
format_args performs eager expansion on its arguments and hygienic context of foo produced by such expansion looks like it was produced by the opaque format_args for some reason, so it's resolved at format_args' definition site.
It maybe either some issue with hygiene infra interacting with eager expansion, but it also may be caused by incorrect spans produced by format_args.
Activity
tesuji commentedon Aug 18, 2019
tesuji commentedon Aug 18, 2019
petrochenkov commentedon Aug 18, 2019
This is a regression from #63114 (cc @matthewjasper).
Slightly more minimized reproduction will look like this:
format_argsperforms eager expansion on its arguments and hygienic context offooproduced by such expansion looks like it was produced by the opaqueformat_argsfor some reason, so it's resolved atformat_args' definition site.It maybe either some issue with hygiene infra interacting with eager expansion, but it also may be caused by incorrect spans produced by
format_args.petrochenkov commentedon Aug 18, 2019
(I'm currently looking into the details.)
UPD: I have a fix locally, will submit tomorrow.
petrochenkov commentedon Aug 19, 2019
Fixed in #63717.
Rollup merge of rust-lang#63717 - petrochenkov:eager, r=matthewjasper