diff options
| author | Joshua Nelson <jyn514@gmail.com> | 2020-09-20 00:32:00 -0400 |
|---|---|---|
| committer | Joshua Nelson <jyn514@gmail.com> | 2020-09-23 21:04:20 -0400 |
| commit | dd7b8c85a6a2bffb2cce1c40ba72680a1d7be93b (patch) | |
| tree | 2a23e7415df3f7537d4399bce754b155fc1388ac /compiler/rustc_codegen_llvm/src | |
| parent | cbc5e4d4d5715cfe111def11bbd1d8afae2ea80e (diff) | |
| download | rust-dd7b8c85a6a2bffb2cce1c40ba72680a1d7be93b.tar.gz rust-dd7b8c85a6a2bffb2cce1c40ba72680a1d7be93b.zip | |
Perform most diagnostic lookups in `resolution_failure`
Previously, these were spread throughout the codebase. This had two
drawbacks:
1. It caused the fast path to be slower: even if a link resolved,
rustdoc would still perform various lookups for the error diagnostic.
2. It was inconsistent and didn't always give all diagnostics (https://github.com/rust-lang/rust/issues/76925)
Now, diagnostics only perform expensive lookups in the error case.
Additionally, the error handling is much more consistent, both in
wording and behavior.
- Remove `CannotHaveAssociatedItems`, `NotInScope`, `NoAssocItem`, and `NotAVariant`
in favor of the more general `NotResolved`
`resolution_failure` will now look up which of the four above
categories is relevant, instead of requiring the rest of the code to
be consistent and accurate in which it picked.
- Remove unnecessary lookups throughout the intra-doc link pass. These
are now done by `resolution_failure`.
+ Remove unnecessary `extra_fragment` argument to `variant_field()`;
it was only used to do lookups on failure.
+ Remove various lookups related to associated items
+ Remove distinction between 'not in scope' and 'no associated item'
- Don't perform unnecessary copies
- Remove unused variables and code
- Update tests
- Note why looking at other namespaces is still necessary
- 'has no inner item' -> 'contains no item'
bless tests
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions
