Skip to content

rustdoc: Also run lint unused_doc_comments #141000

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fmease
Copy link
Member

@fmease fmease commented May 14, 2025

No description provided.

@rustbot rustbot added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label May 14, 2025
@fmease fmease force-pushed the rustdoc-also-run-lint-UNUSED_DOC_COMMENTS branch from 65f0ae4 to 73996f3 Compare May 14, 2025 11:44
@fmease
Copy link
Member Author

fmease commented May 14, 2025

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label May 14, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request May 14, 2025
…DOC_COMMENTS, r=<try>

rustdoc: Also run lint unused_doc_comments
@bors
Copy link
Collaborator

bors commented May 14, 2025

⌛ Trying commit 73996f3 with merge 3e1dfde...

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-19 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
#19 exporting to docker image format
#19 sending tarball 22.3s done
#19 DONE 28.2s
##[endgroup]
Setting extra environment values for docker:  --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/
[CI_JOB_NAME=x86_64-gnu-llvm-19]
[CI_JOB_NAME=x86_64-gnu-llvm-19]
debug: `DISABLE_CI_RUSTC_IF_INCOMPATIBLE` configured.
---
sccache: Listening on address 127.0.0.1:4226
##[group]Configure the build
configure: processing command line
configure: 
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-19', '--enable-llvm-link-shared', '--set', 'rust.randomize-layout=true', '--set', 'rust.thin-lto-import-instr-limit=10', '--set', 'build.print-step-timings', '--enable-verbose-tests', '--set', 'build.metrics', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--set', 'rust.lld=false', '--disable-dist-src', '--release-channel=nightly', '--enable-debug-assertions', '--enable-overflow-checks', '--enable-llvm-assertions', '--set', 'rust.verify-llvm-ir', '--set', 'rust.codegen-backends=llvm,cranelift,gcc', '--set', 'llvm.static-libstdcpp', '--set', 'gcc.download-ci-gcc=true', '--enable-new-symbol-mangling']
configure: build.build          := x86_64-unknown-linux-gnu
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-19/bin/llvm-config
configure: llvm.link-shared     := True
configure: rust.randomize-layout := True
configure: rust.thin-lto-import-instr-limit := 10
---
[RUSTC-TIMING] proc_macro test:false 5.650
[RUSTC-TIMING] test test:false 9.588
    Finished `release` profile [optimized] target(s) in 1m 19s
##[endgroup]
[TIMING] core::build_steps::compile::Std { target: x86_64-unknown-linux-gnu, compiler: Compiler { stage: 1, host: x86_64-unknown-linux-gnu, forced_compiler: true }, crates: [], force_recompile: false, extra_rust_args: ["-Csymbol-mangling-version=v0", "-Cpanic=abort"], is_for_mir_opt_tests: false } -- 79.549
Testing GCC stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
 Downloading crates ...
  Downloaded boml v0.3.1
   Compiling boml v0.3.1
[RUSTC-TIMING] boml test:false 0.782
   Compiling y v0.1.0 (/checkout/compiler/rustc_codegen_gcc/build_system)
[RUSTC-TIMING] y test:false 2.990
    Finished `release` profile [optimized] target(s) in 4.21s
     Running `/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-codegen/x86_64-unknown-linux-gnu/release/y test --use-backend gcc --gcc-path /checkout/obj/build/x86_64-unknown-linux-gnu/ci-gcc/lib --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/cg_gcc --release --mini-tests --std-tests`
`--gcc-path` was provided, ignoring config file. Using `/checkout/obj/build/x86_64-unknown-linux-gnu/ci-gcc/lib` as path for libgccjit
[BUILD] mini_core
[RUSTC-TIMING] mini_core test:false 0.203
[BUILD] example
[AOT] mini_core_hello_world
[RUSTC-TIMING] mini_core_hello_world test:false 0.180
---
+    |
+    = help: use `//` for a plain comment
+    = note: `#[warn(unused_doc_comments)]` on by default
+ 
1 error: `#[doc(alias = "...")]` isn't allowed on foreign module
2   --> $DIR/check-doc-alias-attr-location.rs:7:7
3    |

22 LL |     #[doc(alias = "assoc")]
23    |           ^^^^^^^^^^^^^^^
24 
- error: aborting due to 4 previous errors
+ error: aborting due to 4 previous errors; 1 warning emitted
26 
27 

Note: some mismatched output was normalized before being compared
-   --> /checkout/tests/rustdoc-ui/check-doc-alias-attr-location.rs:7:1
- LL | #[doc(alias = "foo")] //~ ERROR
+ warning: unused doc comment
+   --> $DIR/check-doc-alias-attr-location.rs:7:1
+    |
+ LL | #[doc(alias = "foo")]
+    | ^^^^^^^^^^^^^^^^^^^^^
+ LL | extern "C" {}
---
To only update this specific test, also pass `--test-args check-doc-alias-attr-location.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc" "/checkout/tests/rustdoc-ui/check-doc-alias-attr-location.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc-ui/check-doc-alias-attr-location" "-A" "internal_features" "-Cdebuginfo=0"
stdout: none
--- stderr -------------------------------
warning: unused doc comment
##[warning]  --> /checkout/tests/rustdoc-ui/check-doc-alias-attr-location.rs:7:1
   |
LL | #[doc(alias = "foo")] //~ ERROR
   | ^^^^^^^^^^^^^^^^^^^^^
LL | extern "C" {}
   | ------------- rustdoc does not generate documentation for extern blocks
   |
   = help: use `//` for a plain comment
   = note: `#[warn(unused_doc_comments)]` on by default

error: `#[doc(alias = "...")]` isn't allowed on foreign module
##[error]  --> /checkout/tests/rustdoc-ui/check-doc-alias-attr-location.rs:7:7
   |
LL | #[doc(alias = "foo")] //~ ERROR
   |       ^^^^^^^^^^^^^

error: `#[doc(alias = "...")]` isn't allowed on implementation block
##[error]  --> /checkout/tests/rustdoc-ui/check-doc-alias-attr-location.rs:10:7
   |
LL | #[doc(alias = "bar")] //~ ERROR
   |       ^^^^^^^^^^^^^

error: `#[doc(alias = "...")]` isn't allowed on implementation block
##[error]  --> /checkout/tests/rustdoc-ui/check-doc-alias-attr-location.rs:16:7
   |
LL | #[doc(alias = "foobar")] //~ ERROR
   |       ^^^^^^^^^^^^^^^^

error: `#[doc(alias = "...")]` isn't allowed on type alias in implementation block
##[error]  --> /checkout/tests/rustdoc-ui/check-doc-alias-attr-location.rs:18:11
   |
LL |     #[doc(alias = "assoc")] //~ ERROR
   |           ^^^^^^^^^^^^^^^

error: aborting due to 4 previous errors; 1 warning emitted
------------------------------------------

@bors
Copy link
Collaborator

bors commented May 14, 2025

☀️ Try build successful - checks-actions
Build commit: 3e1dfde (3e1dfde5951b3652538061ac25069965116aaa89)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (3e1dfde): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
1.1% [1.1%, 1.1%] 1
Regressions ❌
(secondary)
0.6% [0.6%, 0.6%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.3% [-0.3%, -0.3%] 1
All ❌✅ (primary) 1.1% [1.1%, 1.1%] 1

Max RSS (memory usage)

Results (primary 2.4%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
2.4% [1.5%, 3.3%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.4% [1.5%, 3.3%] 2

Cycles

Results (primary -0.8%, secondary -7.5%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.9% [2.9%, 2.9%] 1
Improvements ✅
(primary)
-0.8% [-0.8%, -0.8%] 1
Improvements ✅
(secondary)
-8.5% [-15.2%, -2.4%] 10
All ❌✅ (primary) -0.8% [-0.8%, -0.8%] 1

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 773.561s -> 773.672s (0.01%)
Artifact size: 365.44 MiB -> 365.29 MiB (-0.04%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels May 14, 2025
@fmease fmease marked this pull request as ready for review May 15, 2025 09:54
@rustbot
Copy link
Collaborator

rustbot commented May 15, 2025

r? @notriddle

rustbot has assigned @notriddle.
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

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 15, 2025
@fmease
Copy link
Member Author

fmease commented May 15, 2025

Oops, I did not mean to mark as ready.

@fmease fmease marked this pull request as draft May 15, 2025 10:42
@fmease fmease added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf-regression Performance regression. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants