diff options
| author | Joshua Nelson <jnelson@cloudflare.com> | 2022-02-06 18:39:42 -0600 |
|---|---|---|
| committer | Joshua Nelson <jnelson@cloudflare.com> | 2022-02-06 19:29:31 -0600 |
| commit | f026550113b62b7bbd33faf39a7048f5a34fe289 (patch) | |
| tree | 10418785cdd036c26338d4fdd9fffe8e5a210850 /library/std/src/sys/unix/stack_overflow.rs | |
| parent | 7b43cfc9b25ac4a906bd56d32d3111085dd9e6a1 (diff) | |
| download | rust-f026550113b62b7bbd33faf39a7048f5a34fe289.tar.gz rust-f026550113b62b7bbd33faf39a7048f5a34fe289.zip | |
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 also adds a failing test case which will catch trying to remove `all_macros`.
Diffstat (limited to 'library/std/src/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions
