about summary refs log tree commit diff
path: root/src/test/rustdoc-ui/intra-link-errors.stderr
AgeCommit message (Collapse)AuthorLines
2020-11-28Move `src/test/rustdoc-ui` intra-doc tests into a subdirectoryJoshua Nelson-143/+0
This also changes the builder to allow using `x.py test src/test/rustdoc-ui/intra-doc`; before, it would panic that no paths were found.
2020-11-22Get rid of `doctree::Impl`Joshua Nelson-9/+9
2020-10-02Improve error messagesCamelid-5/+5
2020-10-02Use old error when there's partial resolutionCamelid-2/+2
The new error was confusing when there was partial resolution (something like `std::io::nonexistent`); the old one is better for those cases.
2020-10-02Remove unhelpful help messageCamelid-28/+19
2020-10-02Improve rustdoc error for failed intra-doc link resolutionCamelid-24/+33
The previous error was confusing since it made it sound like you can't link to items that are defined outside the current module. Also suggested importing the item.
2020-09-23Unify primitive errors with other intra-link errorsJoshua Nelson-7/+22
Now that `PrimTy::name()` exists, there's no need to carry around the name of the primitive that failed to resolve. This removes the variants special-casing primitives in favor of `NotResolved`. - Remove `NoPrimitiveImpl` and `NoPrimitiveAssocItem` - Remove hacky `has_primitive` check in `resolution_failure()` - Fixup a couple tests that I forgot to `--bless` before
2020-09-23Fix intra-doc links for primitivesJoshua Nelson-4/+1
- Add `PrimTy::name` and `PrimTy::name_str` - Use those new functions to distinguish between the name in scope and the canonical name - Fix diagnostics for primitive types - Add tests for primitives
2020-09-23Perform most diagnostic lookups in `resolution_failure`Joshua Nelson-18/+33
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
2020-09-11Name the current moduleJoshua Nelson-47/+28
'not in scope' -> 'not in `module`'
2020-09-05Find the first segment that failed to resolve for _any_ namespaceJoshua Nelson-14/+30
Moves this detection into `resolution_failure` to avoid doing unnecessary work and make the control flow a little easier to work with.
2020-09-05x.py blessJoshua Nelson-14/+14
2020-09-05Give a much better error message when an item has a macro disambiguatorJoshua Nelson-1/+1
Previously, this called `check_full_res` for values and types, but not macros. This would result in not showing when there was a partial resolution for a parent of the item. This now calls `check_full_res`. Additionally, it checks if there was a disambiguator, and if so, says that specific kind wasn't found instead of saying generically 'associated item'.
2020-09-05 Say 'prefix with `kind@`' instead of 'prefix with the item kind'Joshua Nelson-5/+1
This is both more specific and easier to read.
2020-09-05Don't suggest \[ \] if there's a :: in the pathJoshua Nelson-15/+13
2020-09-05Show the first path segment which failed to resolve.Joshua Nelson-5/+9
Before, it would arbitrarily pick the third-to-last if the last three or more did not resolve.
2020-09-05Give a better error message when linking to a macro with the wrong disambiguatorJoshua Nelson-10/+42
Before: ``` warning: unresolved link to `m` --> m.rs:1:6 | 1 | /// [value@m] | ^^^^^^^ | = note: `#[warn(broken_intra_doc_links)]` on by default = note: no item named `m` is in scope = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` ``` After: ``` warning: unresolved link to `m` --> m.rs:1:6 | 1 | /// [value@m] | ^^^^^^^ help: to link to the macro, use its disambiguator: `m!` | = note: `#[warn(broken_intra_doc_links)]` on by default = note: this link resolves to the macro `m`, which is not in the value namespace ```
2020-09-05Make errors more concise and helpfulJoshua Nelson-16/+12
Before: ``` = note: this link partially resolves to the struct `S` = note: no `fmt` in `S` ``` After: ``` = note: the struct `S` has no field or associated item named `fmt` ```
2020-09-05Don't give misleading errors for `f::A`, where f is in the value namespaceJoshua Nelson-3/+3
2020-09-05Fix tests and improve error message if `::` isn't foundJoshua Nelson-37/+17
2020-09-05Pass on the DefId so rustdoc can name it in suggestionsJoshua Nelson-10/+17
Look at this beauty: ```rust error: unresolved link to `S::h` --> intra-link-errors.rs:51:6 | 51 | /// [type@S::h] | ^^^^^^^^^ help: to link to the associated function, use its disambiguator: `S::h()` | = note: this link resolves to the associated function `h`, which is not in the type namespace ```
2020-09-05Update .stderrJoshua Nelson-15/+53
2020-09-05[WIP] give better errors for broken intra doc linksJoshua Nelson-0/+68