Skip to content

Conversation

@Saphereye
Copy link

@Saphereye Saphereye commented Dec 2, 2025

Fixes: #149483

This PR introduces a flag that hides all deprecated items when generating docs.

For example, given the following code:

#![allow(unused)]
pub struct Visible;

#[deprecated(since = "1.2.3", note = "use Visible instead")]
pub struct OldType;

pub mod m {
    #[deprecated]
    pub fn old_fn() {}
    pub fn new_fn() {}
}

#[deprecated]
pub fn legacy_api() {}

pub fn modern_api() {}

And on generating the docs:

Original After Edits
image image but the symbols still exists, so its still searchable image

Edits:

  • changed behavior from removing symbols to just hiding them

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Dec 2, 2025
@rustbot
Copy link
Collaborator

rustbot commented Dec 2, 2025

r? @GuillaumeGomez

rustbot has assigned @GuillaumeGomez.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez
Copy link
Member

Instead of not generating items, I think adding a setting to hide them would be better.

@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Dec 3, 2025
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-run-make Area: port run-make Makefiles to rmake.rs S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[rustdoc] Add option to hide deprecated items

4 participants