Closed
Description
Problem
currently, the error message when rustdoc errors looks like this:
; RUSTDOCFLAGS=-Dwarnings cargo doc --no-deps --document-private-items --message-format short -q
src/main.rs:1:11: error: unclosed HTML tag `usize`
error: could not document `example`
Caused by:
process didn't exit successfully: `/Users/jyn/.local/lib/rustup/toolchains/nightly-aarch64-apple-darwin/bin/rustdoc --edition=2021 --crate-type bin --crate-name example src/main.rs -o /Users/jyn/.local/lib/cargo/target/doc --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat,diagnostic-short --diagnostic-width=186 --document-private-items '-Arustdoc::private-intra-doc-links' -C metadata=a59e1929dfc569b0 -L dependency=/Users/jyn/.local/lib/cargo/target/debug/deps --extern bitflags=/Users/jyn/.local/lib/cargo/target/debug/deps/libbitflags-d34f162dfbd7ed32.rmeta --extern inner=/Users/jyn/.local/lib/cargo/target/debug/deps/libinner-a5a332b9f54b66cc.rmeta -Dwarnings --crate-version 0.1.0` (exit status: 1)
this is already kind of long, and it gets much worse as you add more dependencies.
Steps
- add some docs that will warn, e.g.
//! Option<usize>
at the root of the crate RUSTDOCFLAGS=-Dwarnings cargo doc
Possible Solution(s)
it would be nice to make it consistent with the error for rustc:
; cargo c -q --message-format short
src/main.rs:10:12: error[E0038]: the trait `Bar` cannot be made into an object
src/main.rs:10:32: error[E0038]: the trait `Bar` cannot be made into an object
error: could not compile `example` (bin "example") due to 2 previous errors
Notes
No response
Version
cargo 1.77.0-nightly (ac6bbb332 2023-12-26)
release: 1.77.0-nightly
commit-hash: ac6bbb33293d8d424c17ecdb42af3aac25fb7295
commit-date: 2023-12-26
host: aarch64-apple-darwin
libgit2: 1.7.1 (sys:0.18.1 vendored)
libcurl: 8.4.0 (sys:0.4.70+curl-8.5.0 system ssl:(SecureTransport) LibreSSL/3.3.6)
ssl: OpenSSL 1.1.1w 11 Sep 2023
os: Mac OS 14.3.0 [64-bit]