-
Notifications
You must be signed in to change notification settings - Fork 12.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve suggestions for broken intra-doc links #75756
Commits on Sep 5, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 3797f29 - Browse repository at this point
Copy the full SHA 3797f29View commit details -
Configuration menu - View commit details
-
Copy full SHA for f45e7b5 - Browse repository at this point
Copy the full SHA f45e7b5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4ace4e7 - Browse repository at this point
Copy the full SHA 4ace4e7View commit details -
Configuration menu - View commit details
-
Copy full SHA for fcb2199 - Browse repository at this point
Copy the full SHA fcb2199View commit details -
Pass on the DefId so rustdoc can name it in suggestions
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 ```
Configuration menu - View commit details
-
Copy full SHA for 42bed03 - Browse repository at this point
Copy the full SHA 42bed03View commit details -
Configuration menu - View commit details
-
Copy full SHA for f4e6ebd - Browse repository at this point
Copy the full SHA f4e6ebdView commit details -
Configuration menu - View commit details
-
Copy full SHA for 002d3a9 - Browse repository at this point
Copy the full SHA 002d3a9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7b8d0be - Browse repository at this point
Copy the full SHA 7b8d0beView commit details -
Make errors more concise and helpful
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` ```
Configuration menu - View commit details
-
Copy full SHA for e2d69f2 - Browse repository at this point
Copy the full SHA e2d69f2View commit details -
Fix failures to resolve primitives
Previously, when looking for the associated items for primitives, rustdoc would look for primitives in the current namespace. But all primitives are in the type namespace. To fix this, rustdoc now always looks for primitives in the namespace when considering them as a stepping stone to the associated item. However, fixing that bug caused several duplicate errors because rustdoc now reports the same error in each namespace. To avoid this, rustdoc now ignores all duplicate errors when issuing them.
Configuration menu - View commit details
-
Copy full SHA for 19d1002 - Browse repository at this point
Copy the full SHA 19d1002View commit details -
Configuration menu - View commit details
-
Copy full SHA for ebc8cb4 - Browse repository at this point
Copy the full SHA ebc8cb4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6875220 - Browse repository at this point
Copy the full SHA 6875220View commit details -
Give a better error message when linking to a macro with the wrong di…
…sambiguator 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 ```
Configuration menu - View commit details
-
Copy full SHA for 418f608 - Browse repository at this point
Copy the full SHA 418f608View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2ca6f11 - Browse repository at this point
Copy the full SHA 2ca6f11View commit details -
Address my own review comments
- Remove unneeded lifetime parameter - Comment why some code doesn't use `check_full_res`
Configuration menu - View commit details
-
Copy full SHA for bb9d157 - Browse repository at this point
Copy the full SHA bb9d157View commit details -
Show the first path segment which failed to resolve.
Before, it would arbitrarily pick the third-to-last if the last three or more did not resolve.
Configuration menu - View commit details
-
Copy full SHA for f2826d9 - Browse repository at this point
Copy the full SHA f2826d9View commit details -
Configuration menu - View commit details
-
Copy full SHA for d67eb1f - Browse repository at this point
Copy the full SHA d67eb1fView commit details -
Say 'prefix with
kind@
' instead of 'prefix with the item kind'This is both more specific and easier to read.
Configuration menu - View commit details
-
Copy full SHA for ee683ef - Browse repository at this point
Copy the full SHA ee683efView commit details -
Give a much better error message when an item has a macro disambiguator
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'.
Configuration menu - View commit details
-
Copy full SHA for efdc3fa - Browse repository at this point
Copy the full SHA efdc3faView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8318a18 - Browse repository at this point
Copy the full SHA 8318a18View commit details -
Find the first segment that failed to resolve for _any_ namespace
Moves this detection into `resolution_failure` to avoid doing unnecessary work and make the control flow a little easier to work with.
Configuration menu - View commit details
-
Copy full SHA for cd72d90 - Browse repository at this point
Copy the full SHA cd72d90View commit details
Commits on Sep 11, 2020
-
box ResolutionFailures on the heap
This decreases the size of the `Result`s being returned, improving performance in the common case.
Configuration menu - View commit details
-
Copy full SHA for c213c68 - Browse repository at this point
Copy the full SHA c213c68View commit details -
Use
span_label
instead ofnote
This puts the error message closer to the link, making it easier to see what went wrong.
Configuration menu - View commit details
-
Copy full SHA for 57250ef - Browse repository at this point
Copy the full SHA 57250efView commit details -
Configuration menu - View commit details
-
Copy full SHA for b2a5a7a - Browse repository at this point
Copy the full SHA b2a5a7aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5ea3eaf - Browse repository at this point
Copy the full SHA 5ea3eafView commit details