diff options
| author | Joshua Nelson <jyn514@gmail.com> | 2020-08-29 09:47:39 -0400 |
|---|---|---|
| committer | Joshua Nelson <jyn514@gmail.com> | 2020-08-30 08:15:08 -0400 |
| commit | 9131d23cc0fb5461050bc19e40a3858b61487069 (patch) | |
| tree | f14a5e764cad14880cff4bb500b6372877629a57 /compiler/rustc_macros/src | |
| parent | a1c71a17090cd5ef732d852ee878114375ff9254 (diff) | |
| download | rust-9131d23cc0fb5461050bc19e40a3858b61487069.tar.gz rust-9131d23cc0fb5461050bc19e40a3858b61487069.zip | |
resolve: Don't speculatively load crates if this is a speculative resolution
This avoids a rare rustdoc bug where loading `core` twice caused a 'cannot find a built-in macro' error: 1. `x.py build --stage 1` builds the standard library and creates a sysroot 2. `cargo doc` does something like `cargo check` to create `rmeta`s for all the crates (unrelated to what was built above) 3. the `cargo check`-like `libcore-*.rmeta` is loaded as a transitive dependency *and claims ownership* of builtin macros 4. `rustdoc` later tries to resolve some path in a doc link 5. suggestion logic fires and loads "extern prelude" crates by name 6. the sysroot `libcore-*.rlib` is loaded and *fails to claim ownership* of builtin macros This fixes step 5. by not running suggestion logic if this is a speculative resolution. Additionally, it marks `resolve_ast_path` as a speculative resolution.
Diffstat (limited to 'compiler/rustc_macros/src')
0 files changed, 0 insertions, 0 deletions
