-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Deprecated doc intra link #150721
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
Deprecated doc intra link #150721
Conversation
| let (doc_fragments, other_attrs) = | ||
| attrs_to_doc_fragments(attrs.iter().map(|attr| (attr, None)), false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the final argument switched from true to false here, which keeps the other attributes. That probably has perf consequences, but I did not want to just make up a doc fragment for the deprecation note.
This comment has been minimized.
This comment has been minimized.
65c9218 to
aacb3d5
Compare
|
Very solid start, thanks! Can you add a While I'm at it, gonna run a perf check. @bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Deprecated doc intra link
This comment has been minimized.
This comment has been minimized.
aacb3d5 to
3663ab8
Compare
| error: unresolved link to `TypeAlias::hoge` | ||
| --> $DIR/deprecated.rs:4:1 | ||
| | | ||
| LL | pub struct A; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like the span is wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I figured out a simple way to at least to a bit better. Now the span of all attributes (including comments) is used.
Getting it to use just the span of #[deprecated] is not worth the trouble I think. At least to me it looks like that would be very invasive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm surprised: we have the spans of the note, so why not use it instead of the whole attribute? Unless I missed something from https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/attrs/struct.Deprecation.html ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That struct does not yet have the Span, but the tricky part is integrating it into report_diagnostic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh you're right, my bad. Do you want to add it or should it be done in a follow-up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really want to mess with report_diagnostic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's ok. It's already an improvement. Then please open an issue linking to this PR (and tag me on it so I can tackle in the next days), fix the CI error and then we're ready to go. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI is happy now and I created #150735
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (a46cf6f): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf. @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 1.1%, secondary -0.8%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary 3.9%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 473.133s -> 473.03s (-0.02%) |
3663ab8 to
fc8a382
Compare
This comment has been minimized.
This comment has been minimized.
fc8a382 to
c01b87b
Compare
|
Looks all good to me, thanks! @bors r+ rollup |
|
🌲 The tree is currently closed for pull requests below priority 1000. This pull request will be tested once the tree is reopened. |
Deprecated doc intra link
|
@bors r- |
|
Commit c01b87b has been unapproved. |
c01b87b to
3be74a7
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. |
…aumeGomez Deprecated doc intra link fixes rust-lang#98342 r? @GuillaumeGomez Renders intra-doc links in the note text of the `#[deprecated]` attribute. It is quite natural to suggest some other function to use there. So e.g. ```rust #[deprecated(since = "0.0.0", note = "use [`std::mem::size_of`] instead")] ``` renders as <img width="431" height="74" alt="Screenshot from 2026-01-06 12-08-21" src="https://github.com/user-attachments/assets/8f608f08-13ee-4bbf-a631-6008058a51e2" />
Rollup of 12 pull requests Successful merges: - #149961 (tidy: add if-installed prefix condition to extra checks system) - #150475 (std: sys: fs: uefi: Implement initial File) - #150533 (std: sys: fs: uefi: Implement remove_dir_all) - #150549 (fix missing_panics_doc in `std::os::fd::owned`) - #150699 (MGCA: Support literals as direct const arguments) - #150721 (Deprecated doc intra link) - #150752 (Update libc to v0.2.180) - #150802 (Minor cleanups to fn_abi_new_uncached) - #150803 (compiler-builtins subtree update) - #150809 (Update `literal-escaper` version to `0.0.7`) - #150811 (Store defids instead of symbol names in the aliases list) - #150825 (Query associated_item_def_ids when needed) r? @ghost
…aumeGomez Deprecated doc intra link fixes rust-lang#98342 r? @GuillaumeGomez Renders intra-doc links in the note text of the `#[deprecated]` attribute. It is quite natural to suggest some other function to use there. So e.g. ```rust #[deprecated(since = "0.0.0", note = "use [`std::mem::size_of`] instead")] ``` renders as <img width="431" height="74" alt="Screenshot from 2026-01-06 12-08-21" src="https://github.com/user-attachments/assets/8f608f08-13ee-4bbf-a631-6008058a51e2" />
…aumeGomez Deprecated doc intra link fixes rust-lang#98342 r? @GuillaumeGomez Renders intra-doc links in the note text of the `#[deprecated]` attribute. It is quite natural to suggest some other function to use there. So e.g. ```rust #[deprecated(since = "0.0.0", note = "use [`std::mem::size_of`] instead")] ``` renders as <img width="431" height="74" alt="Screenshot from 2026-01-06 12-08-21" src="https://github.com/user-attachments/assets/8f608f08-13ee-4bbf-a631-6008058a51e2" />
…aumeGomez Deprecated doc intra link fixes rust-lang#98342 r? @GuillaumeGomez Renders intra-doc links in the note text of the `#[deprecated]` attribute. It is quite natural to suggest some other function to use there. So e.g. ```rust #[deprecated(since = "0.0.0", note = "use [`std::mem::size_of`] instead")] ``` renders as <img width="431" height="74" alt="Screenshot from 2026-01-06 12-08-21" src="https://github.com/user-attachments/assets/8f608f08-13ee-4bbf-a631-6008058a51e2" />
…aumeGomez Deprecated doc intra link fixes rust-lang#98342 r? @GuillaumeGomez Renders intra-doc links in the note text of the `#[deprecated]` attribute. It is quite natural to suggest some other function to use there. So e.g. ```rust #[deprecated(since = "0.0.0", note = "use [`std::mem::size_of`] instead")] ``` renders as <img width="431" height="74" alt="Screenshot from 2026-01-06 12-08-21" src="https://github.com/user-attachments/assets/8f608f08-13ee-4bbf-a631-6008058a51e2" />
…aumeGomez Deprecated doc intra link fixes rust-lang#98342 r? @GuillaumeGomez Renders intra-doc links in the note text of the `#[deprecated]` attribute. It is quite natural to suggest some other function to use there. So e.g. ```rust #[deprecated(since = "0.0.0", note = "use [`std::mem::size_of`] instead")] ``` renders as <img width="431" height="74" alt="Screenshot from 2026-01-06 12-08-21" src="https://github.com/user-attachments/assets/8f608f08-13ee-4bbf-a631-6008058a51e2" />
…aumeGomez Deprecated doc intra link fixes rust-lang#98342 r? @GuillaumeGomez Renders intra-doc links in the note text of the `#[deprecated]` attribute. It is quite natural to suggest some other function to use there. So e.g. ```rust #[deprecated(since = "0.0.0", note = "use [`std::mem::size_of`] instead")] ``` renders as <img width="431" height="74" alt="Screenshot from 2026-01-06 12-08-21" src="https://github.com/user-attachments/assets/8f608f08-13ee-4bbf-a631-6008058a51e2" />
Rollup of 11 pull requests Successful merges: - #149961 (tidy: add if-installed prefix condition to extra checks system) - #150475 (std: sys: fs: uefi: Implement initial File) - #150533 (std: sys: fs: uefi: Implement remove_dir_all) - #150549 (fix missing_panics_doc in `std::os::fd::owned`) - #150699 (MGCA: Support literals as direct const arguments) - #150721 (Deprecated doc intra link) - #150802 (Minor cleanups to fn_abi_new_uncached) - #150803 (compiler-builtins subtree update) - #150809 (Update `literal-escaper` version to `0.0.7`) - #150811 (Store defids instead of symbol names in the aliases list) - #150825 (Query associated_item_def_ids when needed) r? @ghost
Rollup merge of #150721 - deprecated-doc-intra-link, r=GuillaumeGomez Deprecated doc intra link fixes #98342 r? @GuillaumeGomez Renders intra-doc links in the note text of the `#[deprecated]` attribute. It is quite natural to suggest some other function to use there. So e.g. ```rust #[deprecated(since = "0.0.0", note = "use [`std::mem::size_of`] instead")] ``` renders as <img width="431" height="74" alt="Screenshot from 2026-01-06 12-08-21" src="https://github.com/user-attachments/assets/8f608f08-13ee-4bbf-a631-6008058a51e2" />
fixes #98342
r? @GuillaumeGomez
Renders intra-doc links in the note text of the
#[deprecated]attribute. It is quite natural to suggest some other function to use there. So e.g.#[deprecated(since = "0.0.0", note = "use [`std::mem::size_of`] instead")]renders as