rustdoc: Also run lint unused_doc_comments by fmease · Pull Request #141000 · rust-lang/rust (original) (raw)

#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🔞11
   |
LL |     #[doc(alias = "assoc")] //~ ERROR
   |           ^^^^^^^^^^^^^^^

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