Skip to content
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

rustdoc should mark #[deprecated] things as such #14493

Closed
SimonSapin opened this issue May 28, 2014 · 7 comments
Closed

rustdoc should mark #[deprecated] things as such #14493

SimonSapin opened this issue May 28, 2014 · 7 comments
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@SimonSapin
Copy link
Contributor

For example, as of this writing, the StrAllocating::to_owned method is annotated with #[deprecated = "obsolete, use to_string"], but http://doc.rust-lang.org/std/str/trait.StrAllocating.html#method.to_owned gives no indication of that.

@steveklabnik
Copy link
Member

👍 for sure

@lilyball
Copy link
Contributor

lilyball commented Jul 2, 2014

The documentation now has colored bars indicating the stability status of a given API. There's more work to do though. Here's the issues I see:

  • The color bar doesn't tell you what it means when it annotates a function in a function list, like on the linked StrAllocating trait. It only gives the full "deprecated" title when the entire page is about a deprecated item (e.g. native::task::spawn).
  • There's no indication in the trait code listing at the top of the page about which items are deprecated, you have to look at the actual function documentation. It would be nice to add the #[deprecated = "..."] attributes into the code listing.
  • The deprecated display does not list the deprecation message. This last one I think is the most important.

@lilyball
Copy link
Contributor

lilyball commented Jul 2, 2014

cc @aturon, who apparently added the current stability displays in #15263.

Looking at that PR, apparently the deprecation message actually is included, as the title attribute of the color bar. That's rather obscure, I had no way to know that hovering over the bar for long enough would show a tooltip with the message.

@aturon
Copy link
Member

aturon commented Jul 2, 2014

I completely agree with @kballard that there's more work to be done on the visual design here.

My focus in #15263 was just getting the information available at all. Now that it's accessible and being rendered within rustdoc, it should be easy to iterate on the design.

That said, it's nontrivial to balance discoverability with noisyness. Adding text like "experimental" for each item would add a lot of noise, now that libstd is almost entirely at experimental status. If someone has a design in mind for striking a good balance, I'd be happy to implement it (or help guide an implementation).

@aturon
Copy link
Member

aturon commented Jul 2, 2014

cc #15345

@lilyball
Copy link
Contributor

lilyball commented Jul 2, 2014

@aturon For the trait code listing at the top, we should definitely add #[deprecated = ".."] text, because deprecation is important to signal and should be relatively rare. Similarly, in function listings, I think we need a permanent message for deprecation (both to scream "this is deprecated" and to tell the user what the deprecation message is without any interaction).

For other stability attributes, I we can definitely omit them from the code listings, and then I think we can get away with just having mouseover behavior. When I mouse over the function listing, perhaps the stability name could show up right-aligned with some visual treatment.

FWIW, I've advocated in the past for having similar mouseover behavior that exposes a [src] link for every single item. This could coexist with that by either putting the stability attribute to the left of the [src] link, or on a second line below it (if there's room; a function with no documentation may only occupy one line). But we don't currently have mouseover [src] links at all, so we can probably get away with ignoring that.

@steveklabnik
Copy link
Member

while #15468 is newer, it's already added to milestones and such, so I'm closing this as a duplicate of that.

bors added a commit to rust-lang-ci/rust that referenced this issue Jun 5, 2023
…=Veykril

fix: insert whitespace between text and pound

Because `text#`, `text"..."`, and `text'...'` are [reserved syntax since Rust 2021][guide]. Note that the latter two are already handled correctly.

Fixes rust-lang#14487

[guide]: https://doc.rust-lang.org/edition-guide/rust-2021/reserving-syntax.html
@ehuss ehuss mentioned this issue Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants