diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-02-08 06:47:37 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-08 06:47:37 +0100 |
| commit | 1f90f4fb85e9924e24272f6bc12a0c561291c682 (patch) | |
| tree | 802631ca0b5bbdf5274c9862a0e3d485dac9be72 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | |
| parent | 7d5e2ac5eb78c5d3054267bbec5c31fcf8193507 (diff) | |
| parent | f026550113b62b7bbd33faf39a7048f5a34fe289 (diff) | |
| download | rust-1f90f4fb85e9924e24272f6bc12a0c561291c682.tar.gz rust-1f90f4fb85e9924e24272f6bc12a0c561291c682.zip | |
Rollup merge of #93721 - jyn514:less-macro-special-casing, r=petrochenkov
rustdoc: Special-case macro lookups less
Previously, rustdoc had 3 fallbacks it used:
1. `resolve_macro_path`
2. `all_macros`
3. `resolve_str_path_error`
Ideally, it would only use `resolve_str_path_error`, to be consistent with other namespaces.
Unfortunately, that doesn't consider macros that aren't defined at module scope;
consider for instance
```rust
{
struct S;
macro_rules! mac { () => {} }
// `mac`'s scope starts here
/// `mac` <- `resolve_str_path_error` won't see this
struct Z;
//`mac`'s scope ends here
}
```
This changes it to only use `all_macros` and `resolve_str_path_error`, and gives
`resolve_str_path_error` precedence over `all_macros` in case there are two macros with the same
name in the same module.
This is a smaller version of https://github.com/rust-lang/rust/pull/91427.
r? `@petrochenkov`
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
