Add flag to exclude deprecated items in rustdoc
Fixes: rust-lang/rust#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 |
|---|---|
Edits:
- changed behavior from removing symbols to just hiding them
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
The job tidy failed! Check out the build log: (web) (plain enhanced) (plain)
Click to see the possible cause of the failure (guessed by this bot)
Diff in /checkout/src/librustdoc/passes/strip_deprecated.rs:59:
}
// Determine whether this item itself is explicitly deprecated.
- let is_explicitly_deprecated = i
- .def_id()
- .is_some_and(|did| self.tcx.lookup_deprecation(did).is_some());
+ let is_explicitly_deprecated =
+ i.def_id().is_some_and(|did| self.tcx.lookup_deprecation(did).is_some());
if is_explicitly_deprecated {
debug!("strip_deprecated: stripping {:?} {:?}", i.type_(), i.name);
fmt: checked 6587 files
Bootstrap failed while executing `test src/tools/tidy tidyselftest --extra-checks=py,cpp,js,spellcheck`
Build completed unsuccessfully in 0:00:47
local time: Tue Dec 2 17:00:24 UTC 2025
network time: Tue, 02 Dec 2025 17:00:24 GMT
The job aarch64-gnu-llvm-20-2 failed! Check out the build log: (web) (plain enhanced) (plain)
Click to see the possible cause of the failure (guessed by this bot)
151 | exclude_deprecated: bool,
| ------------------------
help: provide the argument
|
75 | let cache = Cache::new(false, false, /* bool */);
| ++++++++++++
For more information about this error, try `rustc --explain E0061`.
[RUSTC-TIMING] rustdoc test:true 12.301
error: could not compile `rustdoc` (lib test) due to 1 previous error
The job x86_64-gnu-gcc failed! Check out the build log: (web) (plain enhanced) (plain)
Click to see the possible cause of the failure (guessed by this bot)
---- [run-make] tests/run-make/rustdoc-default-output stdout ----
error: rmake recipe failed to complete
status: exit status: 101
command: cd "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/rustdoc-default-output/rmake_out" && env -u RUSTFLAGS -u __RUSTC_DEBUG_ASSERTIONS_ENABLED -u __STD_DEBUG_ASSERTIONS_ENABLED AR="ar" BUILD_ROOT="/checkout/obj/build/x86_64-unknown-linux-gnu" CC="cc" CC_DEFAULT_FLAGS="-ffunction-sections -fdata-sections -fPIC -m64" CXX="c++" CXX_DEFAULT_FLAGS="-ffunction-sections -fdata-sections -fPIC -m64" HOST_RUSTC_DYLIB_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib" LD_LIB_PATH_ENVVAR="LD_LIBRARY_PATH" LLVM_BIN_DIR="/checkout/obj/build/x86_64-unknown-linux-gnu/ci-llvm/bin" LLVM_COMPONENTS="aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils aggressiveinstcombine all all-targets amdgpu amdgpuasmparser amdgpucodegen amdgpudesc amdgpudisassembler amdgpuinfo amdgputargetmca amdgpuutils analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils asmparser asmprinter avr avrasmparser avrcodegen avrdesc avrdisassembler avrinfo binaryformat bitreader bitstreamreader bitwriter bpf bpfasmparser bpfcodegen bpfdesc bpfdisassembler bpfinfo cfguard cgdata codegen codegentypes core coroutines coverage csky cskyasmparser cskycodegen cskydesc cskydisassembler cskyinfo debuginfobtf debuginfocodeview debuginfodwarf debuginfodwarflowlevel debuginfogsym debuginfologicalview debuginfomsf debuginfopdb demangle dlltooldriver dwarfcfichecker dwarflinker dwarflinkerclassic dwarflinkerparallel dwp engine executionengine extensions filecheck frontendatomic frontenddirective frontenddriver frontendhlsl frontendoffloading frontendopenacc frontendopenmp fuzzercli fuzzmutate globalisel hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo hipstdpar instcombine instrumentation interfacestub interpreter ipo irprinter irreader jitlink libdriver lineeditor linker loongarch loongarchasmparser loongarchcodegen loongarchdesc loongarchdisassembler loongarchinfo lto m68k m68kasmparser m68kcodegen m68kdesc m68kdisassembler m68kinfo mc mca mcdisassembler mcjit mcparser mips mipsasmparser mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmparser msp430codegen msp430desc msp430disassembler msp430info native nativecodegen nvptx nvptxcodegen nvptxdesc nvptxinfo objcarcopts objcopy object objectyaml option orcdebugging orcjit orcshared orctargetprocess passes powerpc powerpcasmparser powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata remarks riscv riscvasmparser riscvcodegen riscvdesc riscvdisassembler riscvinfo riscvtargetmca runtimedyld sandboxir scalaropts selectiondag sparc sparcasmparser sparccodegen sparcdesc sparcdisassembler sparcinfo support symbolize systemz systemzasmparser systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target targetparser telemetry textapi textapibinaryreader transformutils vectorize webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler webassemblyinfo webassemblyutils windowsdriver windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info x86targetmca xray xtensa xtensaasmparser xtensacodegen xtensadesc xtensadisassembler xtensainfo" LLVM_FILECHECK="/checkout/obj/build/x86_64-unknown-linux-gnu/ci-llvm/bin/FileCheck" PYTHON="/usr/bin/python3" RUSTC="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" RUSTDOC="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc" SOURCE_ROOT="/checkout" TARGET="x86_64-unknown-linux-gnu" TARGET_EXE_DYLIB_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/rustdoc-default-output/rmake"
stdout: none
--- stderr -------------------------------
thread 'main' (51079) panicked at /checkout/tests/run-make/rustdoc-default-output/rmake.rs:15:10:
test failed: `output-default.stdout` is different from `actual`
---
0: __rustc::rust_begin_unwind
at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f/library/std/src/panicking.rs:698:5
1: core::panicking::panic_fmt
at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f/library/core/src/panicking.rs:80:14
2: <run_make_support::diff::Diff>::run
3: rmake::main
4: core::ops::function::FnOnce::call_once
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
------------------------------------------
---- [run-make] tests/run-make/rustdoc-default-output stdout end ----
For more information how to resolve CI failures of this job, visit this link.
Instead of not generating items, I think adding a setting to hide them would be better.
The job x86_64-gnu-gcc failed! Check out the build log: (web) (plain enhanced) (plain)
Click to see the possible cause of the failure (guessed by this bot)
---- [run-make] tests/run-make/rustdoc-default-output stdout ----
error: rmake recipe failed to complete
status: exit status: 101
command: cd "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/rustdoc-default-output/rmake_out" && env -u RUSTFLAGS -u __RUSTC_DEBUG_ASSERTIONS_ENABLED -u __STD_DEBUG_ASSERTIONS_ENABLED AR="ar" BUILD_ROOT="/checkout/obj/build/x86_64-unknown-linux-gnu" CC="cc" CC_DEFAULT_FLAGS="-ffunction-sections -fdata-sections -fPIC -m64" CXX="c++" CXX_DEFAULT_FLAGS="-ffunction-sections -fdata-sections -fPIC -m64" HOST_RUSTC_DYLIB_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib" LD_LIB_PATH_ENVVAR="LD_LIBRARY_PATH" LLVM_BIN_DIR="/checkout/obj/build/x86_64-unknown-linux-gnu/ci-llvm/bin" LLVM_COMPONENTS="aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils aggressiveinstcombine all all-targets amdgpu amdgpuasmparser amdgpucodegen amdgpudesc amdgpudisassembler amdgpuinfo amdgputargetmca amdgpuutils analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils asmparser asmprinter avr avrasmparser avrcodegen avrdesc avrdisassembler avrinfo binaryformat bitreader bitstreamreader bitwriter bpf bpfasmparser bpfcodegen bpfdesc bpfdisassembler bpfinfo cfguard cgdata codegen codegentypes core coroutines coverage csky cskyasmparser cskycodegen cskydesc cskydisassembler cskyinfo debuginfobtf debuginfocodeview debuginfodwarf debuginfodwarflowlevel debuginfogsym debuginfologicalview debuginfomsf debuginfopdb demangle dlltooldriver dwarfcfichecker dwarflinker dwarflinkerclassic dwarflinkerparallel dwp engine executionengine extensions filecheck frontendatomic frontenddirective frontenddriver frontendhlsl frontendoffloading frontendopenacc frontendopenmp fuzzercli fuzzmutate globalisel hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo hipstdpar instcombine instrumentation interfacestub interpreter ipo irprinter irreader jitlink libdriver lineeditor linker loongarch loongarchasmparser loongarchcodegen loongarchdesc loongarchdisassembler loongarchinfo lto m68k m68kasmparser m68kcodegen m68kdesc m68kdisassembler m68kinfo mc mca mcdisassembler mcjit mcparser mips mipsasmparser mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmparser msp430codegen msp430desc msp430disassembler msp430info native nativecodegen nvptx nvptxcodegen nvptxdesc nvptxinfo objcarcopts objcopy object objectyaml option orcdebugging orcjit orcshared orctargetprocess passes powerpc powerpcasmparser powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata remarks riscv riscvasmparser riscvcodegen riscvdesc riscvdisassembler riscvinfo riscvtargetmca runtimedyld sandboxir scalaropts selectiondag sparc sparcasmparser sparccodegen sparcdesc sparcdisassembler sparcinfo support symbolize systemz systemzasmparser systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target targetparser telemetry textapi textapibinaryreader transformutils vectorize webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler webassemblyinfo webassemblyutils windowsdriver windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info x86targetmca xray xtensa xtensaasmparser xtensacodegen xtensadesc xtensadisassembler xtensainfo" LLVM_FILECHECK="/checkout/obj/build/x86_64-unknown-linux-gnu/ci-llvm/bin/FileCheck" PYTHON="/usr/bin/python3" RUSTC="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" RUSTDOC="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc" SOURCE_ROOT="/checkout" TARGET="x86_64-unknown-linux-gnu" TARGET_EXE_DYLIB_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/rustdoc-default-output/rmake"
stdout: none
--- stderr -------------------------------
thread 'main' (51061) panicked at /checkout/tests/run-make/rustdoc-default-output/rmake.rs:15:10:
test failed: `output-default.stdout` is different from `actual`
---
0: __rustc::rust_begin_unwind
at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f/library/std/src/panicking.rs:698:5
1: core::panicking::panic_fmt
at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f/library/core/src/panicking.rs:80:14
2: <run_make_support::diff::Diff>::run
3: rmake::main
4: core::ops::function::FnOnce::call_once
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
------------------------------------------
---- [run-make] tests/run-make/rustdoc-default-output stdout end ----
For more information how to resolve CI failures of this job, visit this link.
The job x86_64-gnu-gcc failed! Check out the build log: (web) (plain enhanced) (plain)
Click to see the possible cause of the failure (guessed by this bot)
---- [run-make] tests/run-make/rustdoc-default-output stdout ----
error: rmake recipe failed to complete
status: exit status: 101
command: cd "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/rustdoc-default-output/rmake_out" && env -u RUSTFLAGS -u __RUSTC_DEBUG_ASSERTIONS_ENABLED -u __STD_DEBUG_ASSERTIONS_ENABLED AR="ar" BUILD_ROOT="/checkout/obj/build/x86_64-unknown-linux-gnu" CC="cc" CC_DEFAULT_FLAGS="-ffunction-sections -fdata-sections -fPIC -m64" CXX="c++" CXX_DEFAULT_FLAGS="-ffunction-sections -fdata-sections -fPIC -m64" HOST_RUSTC_DYLIB_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib" LD_LIB_PATH_ENVVAR="LD_LIBRARY_PATH" LLVM_BIN_DIR="/checkout/obj/build/x86_64-unknown-linux-gnu/ci-llvm/bin" LLVM_COMPONENTS="aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils aggressiveinstcombine all all-targets amdgpu amdgpuasmparser amdgpucodegen amdgpudesc amdgpudisassembler amdgpuinfo amdgputargetmca amdgpuutils analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils asmparser asmprinter avr avrasmparser avrcodegen avrdesc avrdisassembler avrinfo binaryformat bitreader bitstreamreader bitwriter bpf bpfasmparser bpfcodegen bpfdesc bpfdisassembler bpfinfo cfguard cgdata codegen codegentypes core coroutines coverage csky cskyasmparser cskycodegen cskydesc cskydisassembler cskyinfo debuginfobtf debuginfocodeview debuginfodwarf debuginfodwarflowlevel debuginfogsym debuginfologicalview debuginfomsf debuginfopdb demangle dlltooldriver dwarfcfichecker dwarflinker dwarflinkerclassic dwarflinkerparallel dwp engine executionengine extensions filecheck frontendatomic frontenddirective frontenddriver frontendhlsl frontendoffloading frontendopenacc frontendopenmp fuzzercli fuzzmutate globalisel hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo hipstdpar instcombine instrumentation interfacestub interpreter ipo irprinter irreader jitlink libdriver lineeditor linker loongarch loongarchasmparser loongarchcodegen loongarchdesc loongarchdisassembler loongarchinfo lto m68k m68kasmparser m68kcodegen m68kdesc m68kdisassembler m68kinfo mc mca mcdisassembler mcjit mcparser mips mipsasmparser mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmparser msp430codegen msp430desc msp430disassembler msp430info native nativecodegen nvptx nvptxcodegen nvptxdesc nvptxinfo objcarcopts objcopy object objectyaml option orcdebugging orcjit orcshared orctargetprocess passes powerpc powerpcasmparser powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata remarks riscv riscvasmparser riscvcodegen riscvdesc riscvdisassembler riscvinfo riscvtargetmca runtimedyld sandboxir scalaropts selectiondag sparc sparcasmparser sparccodegen sparcdesc sparcdisassembler sparcinfo support symbolize systemz systemzasmparser systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target targetparser telemetry textapi textapibinaryreader transformutils vectorize webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler webassemblyinfo webassemblyutils windowsdriver windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info x86targetmca xray xtensa xtensaasmparser xtensacodegen xtensadesc xtensadisassembler xtensainfo" LLVM_FILECHECK="/checkout/obj/build/x86_64-unknown-linux-gnu/ci-llvm/bin/FileCheck" PYTHON="/usr/bin/python3" RUSTC="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" RUSTDOC="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc" SOURCE_ROOT="/checkout" TARGET="x86_64-unknown-linux-gnu" TARGET_EXE_DYLIB_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/rustdoc-default-output/rmake"
stdout: none
--- stderr -------------------------------
thread 'main' (51089) panicked at /checkout/tests/run-make/rustdoc-default-output/rmake.rs:15:10:
test failed: `output-default.stdout` is different from `actual`
---
0: __rustc::rust_begin_unwind
at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f/library/std/src/panicking.rs:698:5
1: core::panicking::panic_fmt
at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f/library/core/src/panicking.rs:80:14
2: <run_make_support::diff::Diff>::run
3: rmake::main
4: core::ops::function::FnOnce::call_once
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
------------------------------------------
---- [run-make] tests/run-make/rustdoc-default-output stdout end ----
For more information how to resolve CI failures of this job, visit this link.
The job tidy failed! Check out the build log: (web) (plain enhanced) (plain)
Click to see the possible cause of the failure (guessed by this bot)
[TIMING:end] tool::ToolBuild { build_compiler: Compiler { stage: 0, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target: x86_64-unknown-linux-gnu, tool: "tidy", path: "src/tools/tidy", mode: ToolBootstrap, source_type: InTree, extra_features: [], allow_features: "", cargo_args: [], artifact_kind: Binary } -- 11.979
[TIMING:end] tool::Tidy { compiler: Compiler { stage: 0, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target: x86_64-unknown-linux-gnu } -- 0.000
fmt check
Diff in /checkout/src/librustdoc/html/render/print_item.rs:427:
clean::ImportItem(ref import) => {
if let Some(import_def_id) = import.source.did {
let depr = tcx.lookup_deprecation(import_def_id).is_some();
- let unst = tcx
- .lookup_stability(import_def_id)
- .is_some_and(|s| s.is_unstable() && s.feature != sym::rustc_private);
+ let unst = tcx.lookup_stability(import_def_id).is_some_and(|s| {
+ s.is_unstable() && s.feature != sym::rustc_private
+ });
(depr, unst)
} else {
(false, false)
fmt: checked 6590 files
Added a flag to hide unstable items (based on feedback in the parent issue). I also tried adding a corresponding option in the settings panel, but ran into two issues:
-
Not all elements can be reliably identified as unstable or deprecated via existing tags, so they still appear in places like the sidebar. I experimented with injecting extra metadata into the generated nodes, but it felt hacky and would require adding the metadata to many places. In the future if we were to add more hiding flags this would bloat the docs(?)
-
I couldn’t make the settings option persist and apply responsively across pages. Enabling it on one page wouldn’t carry over to the next, and elements only refreshed to the hidden state after reopening the settings panel.
I will check this out more but will keep the flags for now.
The job aarch64-gnu-llvm-20-2 failed! Check out the build log: (web) (plain enhanced) (plain)
Click to see the possible cause of the failure (guessed by this bot)
154 | hide_unstable: bool,
| -------------------
help: provide the argument
|
75 | let cache = Cache::new(false, false, false, /* bool */);
| ++++++++++++
For more information about this error, try `rustc --explain E0061`.
[RUSTC-TIMING] rustdoc test:true 12.725
error: could not compile `rustdoc` (lib test) due to 1 previous error
Instead of not generating items, I think adding a setting to hide them would be better.
I meant in the JS settings, not at doc generation time.
We talked about this feature in last rustdoc team meeting and it was unanimously accepted by the members present at the time. However, we'd like the implementation to be like https://github.com/rust-lang/rust/pull/141299. Could you update your PR please?
Some changes occurred in HTML/CSS/JS.
cc @GuillaumeGomez, @lolbinarycat
The job tidy failed! Check out the build log: (web) (plain enhanced) (plain)
Click to see the possible cause of the failure (guessed by this bot)
[TIMING:end] tool::Tidy { compiler: Compiler { stage: 0, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target: x86_64-unknown-linux-gnu } -- 0.000
fmt check
Diff in /checkout/src/librustdoc/html/render/sidebar.rs:117:
impl<'a> Link<'a> {
pub fn new(href: impl Into<Cow<'a, str>>, name: impl Into<Cow<'a, str>>) -> Self {
- Self { href: href.into(), name: name.into(), children: vec![], name_html: None, deprecated: false }
+ Self {
+ href: href.into(),
+ name: name.into(),
+ children: vec![],
+ name_html: None,
+ deprecated: false,
+ }
}
pub fn empty() -> Link<'static> {
Link::new("", "")
Diff in /checkout/src/librustdoc/html/render/sidebar.rs:465:
// Inject non-visual marker for deprecated filtering in sidebar entries
// by appending a hidden span to the displayed name.
// Note: we rely on `Link::new` to accept enriched HTML for the name.
- Link::new(l.href.clone(), format!("{}<span class=\"depr-item\" hidden></span>", l.name))
+ Link::new(
+ l.href.clone(),
+ format!("{}<span class=\"depr-item\" hidden></span>", l.name),
+ )
})
.collect(),
),
Diff in /checkout/src/librustdoc/html/render/sidebar.rs:475:
assoc_types
.into_iter()
.map(|l| {
- Link::new(l.href.clone(), format!("{}<span class=\"depr-item\" hidden></span>", l.name))
+ Link::new(
+ l.href.clone(),
+ format!("{}<span class=\"depr-item\" hidden></span>", l.name),
+ )
})
.collect(),
),
Diff in /checkout/src/librustdoc/html/render/sidebar.rs:485:
methods
.into_iter()
.map(|l| {
- Link::new(l.href.clone(), format!("{}<span class=\"depr-item\" hidden></span>", l.name))
+ Link::new(
+ l.href.clone(),
+ format!("{}<span class=\"depr-item\" hidden></span>", l.name),
+ )
})
.collect(),
),
Diff in /checkout/src/librustdoc/html/render/sidebar.rs:708:
let mut l = Link::new(format!("struct.{name_str}"), name_str.to_string());
if it.deprecation(cx.tcx()).is_some_and(|d| d.is_in_effect()) {
l.deprecated = true;
- l.name_html = Some(format!(
- "{} <span class=\"stab deprecated\">Deprecated</span>",
- name_str
- ).into());
+ l.name_html = Some(
+ format!("{} <span class=\"stab deprecated\">Deprecated</span>", name_str)
+ .into(),
+ );
}
structs.push(l);
}
Diff in /checkout/src/librustdoc/html/render/sidebar.rs:719:
let mut l = Link::new(format!("fn.{name_str}"), name_str.to_string());
if it.deprecation(cx.tcx()).is_some_and(|d| d.is_in_effect()) {
l.deprecated = true;
- l.name_html = Some(format!(
- "{} <span class=\"stab deprecated\">Deprecated</span>",
- name_str
- ).into());
+ l.name_html = Some(
+ format!("{} <span class=\"stab deprecated\">Deprecated</span>", name_str)
+ .into(),
+ );
}
functions.push(l);
}
Diff in /checkout/src/librustdoc/html/render/sidebar.rs:730:
let mut l = Link::new(format!("enum.{name_str}"), name_str.to_string());
if it.deprecation(cx.tcx()).is_some_and(|d| d.is_in_effect()) {
l.deprecated = true;
- l.name_html = Some(format!(
- "{} <span class=\"stab deprecated\">Deprecated</span>",
- name_str
- ).into());
+ l.name_html = Some(
+ format!("{} <span class=\"stab deprecated\">Deprecated</span>", name_str)
+ .into(),
+ );
}
enums.push(l);
}
Diff in /checkout/src/librustdoc/html/render/sidebar.rs:741:
let mut l = Link::new(format!("type.{name_str}"), name_str.to_string());
if it.deprecation(cx.tcx()).is_some_and(|d| d.is_in_effect()) {
l.deprecated = true;
- l.name_html = Some(format!(
- "{} <span class=\"stab deprecated\">Deprecated</span>",
- name_str
- ).into());
+ l.name_html = Some(
+ format!("{} <span class=\"stab deprecated\">Deprecated</span>", name_str)
+ .into(),
+ );
}
type_aliases.push(l);
}
Diff in /checkout/src/librustdoc/html/render/sidebar.rs:752:
let mut l = Link::new(format!("constant.{name_str}"), name_str.to_string());
if it.deprecation(cx.tcx()).is_some_and(|d| d.is_in_effect()) {
l.deprecated = true;
- l.name_html = Some(format!(
- "{} <span class=\"stab deprecated\">Deprecated</span>",
- name_str
- ).into());
+ l.name_html = Some(
+ format!("{} <span class=\"stab deprecated\">Deprecated</span>", name_str)
+ .into(),
+ );
}
constants.push(l);
}
Diff in /checkout/src/librustdoc/html/render/sidebar.rs:763:
let mut l = Link::new(format!("mod.{name_str}"), name_str.to_string());
if it.deprecation(cx.tcx()).is_some_and(|d| d.is_in_effect()) {
l.deprecated = true;
- l.name_html = Some(format!(
- "{} <span class=\"stab deprecated\">Deprecated</span>",
- name_str
- ).into());
+ l.name_html = Some(
+ format!("{} <span class=\"stab deprecated\">Deprecated</span>", name_str)
+ .into(),
+ );
}
modules.push(l);
}
Diff in /checkout/src/librustdoc/html/render/sidebar.rs:896:
get_next_url(used_links, format!("{typ}.{name}", typ = ItemType::Method)),
name.as_str(),
);
- if item
- .deprecation(tcx)
- .is_some_and(|d| d.is_in_effect())
- {
+ if item.deprecation(tcx).is_some_and(|d| d.is_in_effect()) {
// Mark as deprecated for template-based class insertion
link.deprecated = true;
// Also render the native deprecation tag in the link label
Diff in /checkout/src/librustdoc/html/render/sidebar.rs:906:
- link.name_html = Some(format!(
- "{} <span class=\"stab deprecated\">Deprecated</span>",
- name
- ).into());
+ link.name_html = Some(
+ format!("{} <span class=\"stab deprecated\">Deprecated</span>", name)
+ .into(),
+ );
}
Some(link)
}
Diff in /checkout/src/librustdoc/html/render/sidebar.rs:930:
{
{
let mut link = Link::new(
- get_next_url(used_links, format!("{typ}.{name}", typ = ItemType::AssocConst)),
+ get_next_url(
+ used_links,
+ format!("{typ}.{name}", typ = ItemType::AssocConst),
+ ),
name.as_str(),
);
- if item
- .deprecation(tcx)
- .is_some_and(|d| d.is_in_effect())
- {
+ if item.deprecation(tcx).is_some_and(|d| d.is_in_effect()) {
// Mark for template-based class insertion
link.deprecated = true;
// Also render the native deprecation tag in the link label
Diff in /checkout/src/librustdoc/html/render/sidebar.rs:943:
- link.name_html = Some(format!(
- "{} <span class=\"stab deprecated\">Deprecated</span>",
- name
- ).into());
+ link.name_html = Some(
+ format!("{} <span class=\"stab deprecated\">Deprecated</span>", name)
+ .into(),
+ );
}
Some(link)
}
Diff in /checkout/src/librustdoc/html/render/sidebar.rs:969:
get_next_url(used_links, format!("{typ}.{name}", typ = ItemType::AssocType)),
name.as_str(),
);
- if item
- .deprecation(tcx)
- .is_some_and(|d| d.is_in_effect())
- {
+ if item.deprecation(tcx).is_some_and(|d| d.is_in_effect()) {
link.deprecated = true;
- link.name_html = Some(format!(
- "{} <span class=\"stab deprecated\">Deprecated</span>",
- name
- ).into());
+ link.name_html = Some(
+ format!("{} <span class=\"stab deprecated\">Deprecated</span>", name)
+ .into(),
+ );
}
Some(link)
} else {
The job tidy failed! Check out the build log: (web) (plain enhanced) (plain)
Click to see the possible cause of the failure (guessed by this bot)
[TIMING:end] tool::Tidy { compiler: Compiler { stage: 0, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target: x86_64-unknown-linux-gnu } -- 0.000
fmt check
Diff in /checkout/src/librustdoc/html/render/sidebar.rs:117:
impl<'a> Link<'a> {
pub fn new(href: impl Into<Cow<'a, str>>, name: impl Into<Cow<'a, str>>) -> Self {
- Self { href: href.into(), name: name.into(), children: vec![], name_html: None, deprecated: false }
+ Self {
+ href: href.into(),
+ name: name.into(),
+ children: vec![],
+ name_html: None,
+ deprecated: false,
+ }
}
pub fn empty() -> Link<'static> {
Link::new("", "")
Diff in /checkout/src/librustdoc/html/render/sidebar.rs:465:
// Inject non-visual marker for deprecated filtering in sidebar entries
// by appending a hidden span to the displayed name.
// Note: we rely on `Link::new` to accept enriched HTML for the name.
- Link::new(l.href.clone(), format!("{}<span class=\"depr-item\" hidden></span>", l.name))
+ Link::new(
+ l.href.clone(),
+ format!("{}<span class=\"depr-item\" hidden></span>", l.name),
+ )
})
.collect(),
),
Diff in /checkout/src/librustdoc/html/render/sidebar.rs:475:
assoc_types
.into_iter()
.map(|l| {
- Link::new(l.href.clone(), format!("{}<span class=\"depr-item\" hidden></span>", l.name))
+ Link::new(
+ l.href.clone(),
+ format!("{}<span class=\"depr-item\" hidden></span>", l.name),
+ )
})
.collect(),
),
Diff in /checkout/src/librustdoc/html/render/sidebar.rs:485:
methods
.into_iter()
.map(|l| {
- Link::new(l.href.clone(), format!("{}<span class=\"depr-item\" hidden></span>", l.name))
+ Link::new(
+ l.href.clone(),
+ format!("{}<span class=\"depr-item\" hidden></span>", l.name),
+ )
})
.collect(),
),
Diff in /checkout/src/librustdoc/html/render/sidebar.rs:708:
let mut l = Link::new(format!("struct.{name_str}"), name_str.to_string());
if it.deprecation(cx.tcx()).is_some_and(|d| d.is_in_effect()) {
l.deprecated = true;
- l.name_html = Some(format!(
- "{} <span class=\"stab deprecated\">Deprecated</span>",
- name_str
- ).into());
+ l.name_html = Some(
+ format!("{} <span class=\"stab deprecated\">Deprecated</span>", name_str)
+ .into(),
+ );
}
structs.push(l);
}
Diff in /checkout/src/librustdoc/html/render/sidebar.rs:719:
let mut l = Link::new(format!("fn.{name_str}"), name_str.to_string());
if it.deprecation(cx.tcx()).is_some_and(|d| d.is_in_effect()) {
l.deprecated = true;
- l.name_html = Some(format!(
- "{} <span class=\"stab deprecated\">Deprecated</span>",
- name_str
- ).into());
+ l.name_html = Some(
+ format!("{} <span class=\"stab deprecated\">Deprecated</span>", name_str)
+ .into(),
+ );
}
functions.push(l);
}
Diff in /checkout/src/librustdoc/html/render/sidebar.rs:730:
let mut l = Link::new(format!("enum.{name_str}"), name_str.to_string());
if it.deprecation(cx.tcx()).is_some_and(|d| d.is_in_effect()) {
l.deprecated = true;
- l.name_html = Some(format!(
- "{} <span class=\"stab deprecated\">Deprecated</span>",
- name_str
- ).into());
+ l.name_html = Some(
+ format!("{} <span class=\"stab deprecated\">Deprecated</span>", name_str)
+ .into(),
+ );
}
enums.push(l);
}
Diff in /checkout/src/librustdoc/html/render/sidebar.rs:741:
let mut l = Link::new(format!("type.{name_str}"), name_str.to_string());
if it.deprecation(cx.tcx()).is_some_and(|d| d.is_in_effect()) {
l.deprecated = true;
- l.name_html = Some(format!(
- "{} <span class=\"stab deprecated\">Deprecated</span>",
- name_str
- ).into());
+ l.name_html = Some(
+ format!("{} <span class=\"stab deprecated\">Deprecated</span>", name_str)
+ .into(),
+ );
}
type_aliases.push(l);
}
Diff in /checkout/src/librustdoc/html/render/sidebar.rs:752:
let mut l = Link::new(format!("constant.{name_str}"), name_str.to_string());
if it.deprecation(cx.tcx()).is_some_and(|d| d.is_in_effect()) {
l.deprecated = true;
- l.name_html = Some(format!(
- "{} <span class=\"stab deprecated\">Deprecated</span>",
- name_str
- ).into());
+ l.name_html = Some(
+ format!("{} <span class=\"stab deprecated\">Deprecated</span>", name_str)
+ .into(),
+ );
}
constants.push(l);
}
Diff in /checkout/src/librustdoc/html/render/sidebar.rs:763:
let mut l = Link::new(format!("mod.{name_str}"), name_str.to_string());
if it.deprecation(cx.tcx()).is_some_and(|d| d.is_in_effect()) {
l.deprecated = true;
- l.name_html = Some(format!(
- "{} <span class=\"stab deprecated\">Deprecated</span>",
- name_str
- ).into());
+ l.name_html = Some(
+ format!("{} <span class=\"stab deprecated\">Deprecated</span>", name_str)
+ .into(),
+ );
}
modules.push(l);
}
Diff in /checkout/src/librustdoc/html/render/sidebar.rs:896:
get_next_url(used_links, format!("{typ}.{name}", typ = ItemType::Method)),
name.as_str(),
);
- if item
- .deprecation(tcx)
- .is_some_and(|d| d.is_in_effect())
- {
+ if item.deprecation(tcx).is_some_and(|d| d.is_in_effect()) {
// Mark as deprecated for template-based class insertion
link.deprecated = true;
// Also render the native deprecation tag in the link label
Diff in /checkout/src/librustdoc/html/render/sidebar.rs:906:
- link.name_html = Some(format!(
- "{} <span class=\"stab deprecated\">Deprecated</span>",
- name
- ).into());
+ link.name_html = Some(
+ format!("{} <span class=\"stab deprecated\">Deprecated</span>", name)
+ .into(),
+ );
}
Some(link)
}
Diff in /checkout/src/librustdoc/html/render/sidebar.rs:930:
{
{
let mut link = Link::new(
- get_next_url(used_links, format!("{typ}.{name}", typ = ItemType::AssocConst)),
+ get_next_url(
+ used_links,
+ format!("{typ}.{name}", typ = ItemType::AssocConst),
+ ),
name.as_str(),
);
- if item
- .deprecation(tcx)
- .is_some_and(|d| d.is_in_effect())
- {
+ if item.deprecation(tcx).is_some_and(|d| d.is_in_effect()) {
// Mark for template-based class insertion
link.deprecated = true;
// Also render the native deprecation tag in the link label
Diff in /checkout/src/librustdoc/html/render/sidebar.rs:943:
- link.name_html = Some(format!(
- "{} <span class=\"stab deprecated\">Deprecated</span>",
- name
- ).into());
+ link.name_html = Some(
+ format!("{} <span class=\"stab deprecated\">Deprecated</span>", name)
+ .into(),
+ );
}
Some(link)
}
Diff in /checkout/src/librustdoc/html/render/sidebar.rs:969:
get_next_url(used_links, format!("{typ}.{name}", typ = ItemType::AssocType)),
name.as_str(),
);
- if item
- .deprecation(tcx)
- .is_some_and(|d| d.is_in_effect())
- {
+ if item.deprecation(tcx).is_some_and(|d| d.is_in_effect()) {
link.deprecated = true;
- link.name_html = Some(format!(
- "{} <span class=\"stab deprecated\">Deprecated</span>",
- name
- ).into());
+ link.name_html = Some(
+ format!("{} <span class=\"stab deprecated\">Deprecated</span>", name)
+ .into(),
+ );
}
Some(link)
} else {