]> git.lizzy.rs Git - rust.git/commit
Merge #11347
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>
Wed, 26 Jan 2022 17:35:51 +0000 (17:35 +0000)
committerGitHub <noreply@github.com>
Wed, 26 Jan 2022 17:35:51 +0000 (17:35 +0000)
commit28b65d3e0c4b3af910056781ecf9c4d6f1e26dc6
treed602351e47f3d436dca5447ed87139677c13ab39
parent1f0c20e8ba6e48a14f50e77ce1a472a6543182b7
parent35e5c3b3f9075c86d950cd774db3b904be0aa478
Merge #11347

11347: fix: Fix resolution of eager macro contents r=jonas-schievink a=jonas-schievink

Eager macros resolve and expand any contained macro invocations before they are expanded. The logic for this was previously pretty broken: any nameres failure would be reported as a generic macro expansion error, so this didn't work correctly with the fixed-point resolution loop. This manifested as spurious errors whenever a non-legacy macro was used in an eager macro (that means *any* path with more than one segment).

After an intense staring contest with the abyss, this PR fixes the basic logic, but some bugs still remain (particularly around `$crate`). As a side-effect, this PR moves `ModPath` into `hir_expand`.

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>