-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Ignore #[doc(hidden)] items when computing trimmed paths for printing
#148623
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
base: main
Are you sure you want to change the base?
Conversation
|
This PR modifies |
|
r? @wesleywiser rustbot has assigned @wesleywiser. Use |
This comment has been minimized.
This comment has been minimized.
3d01a43 to
700790b
Compare
This comment has been minimized.
This comment has been minimized.
700790b to
f78921a
Compare
#[doc(hidden)] items when computing trimmed paths for diagnostics#[doc(hidden)] items when computing trimmed paths for printing
This comment was marked as resolved.
This comment was marked as resolved.
f78921a to
d2ef4a3
Compare
This comment has been minimized.
This comment has been minimized.
This comment was marked as resolved.
This comment was marked as resolved.
d2ef4a3 to
c9a5d13
Compare
This comment has been minimized.
This comment has been minimized.
c9a5d13 to
5a21a8f
Compare
This comment has been minimized.
This comment has been minimized.
This comment was marked as resolved.
This comment was marked as resolved.
5a21a8f to
8ec6f89
Compare
This comment has been minimized.
This comment has been minimized.
|
@rustbot ready |
8ec6f89 to
8f5a7e8
Compare
This comment has been minimized.
This comment has been minimized.
|
@rustbot ready |
0531a74 to
a30f76e
Compare
This comment has been minimized.
This comment has been minimized.
This comment was marked as resolved.
This comment was marked as resolved.
a30f76e to
7e71fb0
Compare
This comment has been minimized.
This comment has been minimized.
|
Ah, looks like some of the conflicting files were not properly re-blessed due to debug assertions. |
7e71fb0 to
48a1935
Compare
48a1935 to
2c456e9
Compare
This comment has been minimized.
This comment has been minimized.
|
r? compiler |
This comment was marked as resolved.
This comment was marked as resolved.
2c456e9 to
61613ca
Compare
This comment has been minimized.
This comment has been minimized.
61613ca to
c9dce7a
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
c9dce7a to
2df2c72
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@bors r+ |
Ignore `#[doc(hidden)]` items when computing trimmed paths for printing The `trimmed_def_paths` query examines all items in the current crate, and all pub items in immediate-dependency crates (including the standard library), to see which item names are unique and can therefore be printed unambiguously as a bare name without a module path. Currently that query has no special handling for `#[doc(hidden)]` items, which has two consequences: - Hidden names can be considered unique, and will therefore be printed without a path, making it hard to find where that name is defined (since it normally isn't listed in documentation). - Hidden names can conflict with visible names that would otherwise be considered unique, causing diagnostics to mysteriously become more verbose based on internal details of other crates. This PR therefore makes the `trimmed_def_paths` query ignore external-crate items that are `#[doc(hidden)]`, along with their descendants. As a result, hidden item names are never considered unique for trimming, and no longer interfere with visible item names being considered unique. --- - Fixes rust-lang#148387.
The
trimmed_def_pathsquery examines all items in the current crate, and all pub items in immediate-dependency crates (including the standard library), to see which item names are unique and can therefore be printed unambiguously as a bare name without a module path.Currently that query has no special handling for
#[doc(hidden)]items, which has two consequences:This PR therefore makes the
trimmed_def_pathsquery ignore external-crate items that are#[doc(hidden)], along with their descendants.As a result, hidden item names are never considered unique for trimming, and no longer interfere with visible item names being considered unique.