Skip to content

Spurious "Unrecognized option" message on rustdoc panic #93579

Closed
@ijackson

Description

@ijackson

With a version of rustdoc affected by #93428, I observe this when this bug occurs:

rustcargo@zealot:/home/ian/Rustup/Arti/Build/arti$ cargo doc --all-features
 Documenting tor-dirmgr v0.0.4 (/volatile/rustcargo/Rustup/Arti/arti/crates/tor-dirmgr)
thread 'rustc' panicked at 'no entry found for key', src/librustdoc/passes/collect_intra_doc_links.rs:929:16
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

error: Unrecognized option: 'default-theme'

error: could not document `tor-dirmgr`

Caused by:
  process didn't exit successfully: `rustdoc --edition=2018 --crate-type lib --crate-name tor_dirmgr crates/tor-dirmgr/src/lib.rs -o /volatile/rustcargo/Rustup/Arti/arti/target/doc --cfg 'feature="default"' --cfg 'feature="memmap2"' --cfg 'feature="mmap"' --cfg 'feature="routerdesc"' --cfg 'feature="static"' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat -C metadata=aa53d6299379729d -L dependency=/volatile/rustcargo/Rustup/Arti/arti/target/debug/deps --extern async_trait=/volatile/rustcargo/Rustup/Arti/arti/target/debug/deps/libasync_trait-25efcc67c068c75d.so --extern base64=/volatile/rustcargo/Rustup/Arti/arti/target/debug/deps/libbase64-fc54b7dac8c37ff8.rmeta --extern derive_builder=/volatile/rustcargo/Rustup/Arti/arti/target/debug/deps/libderive_builder-e0d29543f3ee71f0.rmeta --extern digest=/volatile/rustcargo/Rustup/Arti/arti/target/debug/deps/libdigest-5294b49980fdd964.rmeta --extern event_listener=/volatile/rustcargo/Rustup/Arti/arti/target/debug/deps/libevent_listener-e7e03de28283491f.rmeta --extern fslock=/volatile/rustcargo/Rustup/Arti/arti/target/debug/deps/libfslock-b312da71e00a939e.rmeta --extern futures=/volatile/rustcargo/Rustup/Arti/arti/target/debug/deps/libfutures-12328c3c53c18ce6.rmeta --extern hex=/volatile/rustcargo/Rustup/Arti/arti/target/debug/deps/libhex-52738f6114d4bb1b.rmeta --extern humantime_serde=/volatile/rustcargo/Rustup/Arti/arti/target/debug/deps/libhumantime_serde-a8656ada3a9f6f8c.rmeta --extern itertools=/volatile/rustcargo/Rustup/Arti/arti/target/debug/deps/libitertools-ed6d9e96085d6069.rmeta --extern memmap2=/volatile/rustcargo/Rustup/Arti/arti/target/debug/deps/libmemmap2-00f241de9244ddb8.rmeta --extern once_cell=/volatile/rustcargo/Rustup/Arti/arti/target/debug/deps/libonce_cell-88ef809ea5bdbc77.rmeta --extern postage=/volatile/rustcargo/Rustup/Arti/arti/target/debug/deps/libpostage-3cd2da63b038b761.rmeta --extern rand=/volatile/rustcargo/Rustup/Arti/arti/target/debug/deps/librand-f007c982c8c51a12.rmeta --extern retry_error=/volatile/rustcargo/Rustup/Arti/arti/target/debug/deps/libretry_error-0d1a42193f831f72.rmeta --extern rusqlite=/volatile/rustcargo/Rustup/Arti/arti/target/debug/deps/librusqlite-d24ed85c86b154d0.rmeta --extern serde=/volatile/rustcargo/Rustup/Arti/arti/target/debug/deps/libserde-9913dbbfcd998186.rmeta --extern signature=/volatile/rustcargo/Rustup/Arti/arti/target/debug/deps/libsignature-bfa06a9a193347a4.rmeta --extern thiserror=/volatile/rustcargo/Rustup/Arti/arti/target/debug/deps/libthiserror-e3a57847eed1a010.rmeta --extern time=/volatile/rustcargo/Rustup/Arti/arti/target/debug/deps/libtime-974a8c2e4079d94d.rmeta --extern tor_checkable=/volatile/rustcargo/Rustup/Arti/arti/target/debug/deps/libtor_checkable-e335accabe64e5a3.rmeta --extern tor_circmgr=/volatile/rustcargo/Rustup/Arti/arti/target/debug/deps/libtor_circmgr-cfe77275198ffc13.rmeta --extern tor_config=/volatile/rustcargo/Rustup/Arti/arti/target/debug/deps/libtor_config-f4196bf5d1cab21d.rmeta --extern tor_consdiff=/volatile/rustcargo/Rustup/Arti/arti/target/debug/deps/libtor_consdiff-0616a72a65b2c3a7.rmeta --extern tor_dirclient=/volatile/rustcargo/Rustup/Arti/arti/target/debug/deps/libtor_dirclient-374a51644580a5f2.rmeta --extern tor_llcrypto=/volatile/rustcargo/Rustup/Arti/arti/target/debug/deps/libtor_llcrypto-a259a67655059250.rmeta --extern tor_netdir=/volatile/rustcargo/Rustup/Arti/arti/target/debug/deps/libtor_netdir-77e64a6473cb5820.rmeta --extern tor_netdoc=/volatile/rustcargo/Rustup/Arti/arti/target/debug/deps/libtor_netdoc-749221325fef0cc1.rmeta --extern tor_rtcompat=/volatile/rustcargo/Rustup/Arti/arti/target/debug/deps/libtor_rtcompat-3cd44dd5107fb13d.rmeta --extern tracing=/volatile/rustcargo/Rustup/Arti/arti/target/debug/deps/libtracing-90e2cc81476e06ab.rmeta --default-theme ayu --crate-version 0.0.4` (exit status: 1)
rustcargo@zealot:/home/ian/Rustup/Arti/Build/arti$ 

Note the message

error: Unrecognized option: 'default-theme'

which seems to be entirely spurious. The output in #93428 and the dupe #93539 has

error: Unrecognized option: 'crate-version'

I think I am getting the complaint about default-theme instead of crate-version because I have that set in my rustdocflags in ~/.cargo/config. Both the complained-about options do exist, and everything works when rustdoc isn't panicking.

It seems that something must be wrong with the panic handling. It restarts argument processing somehow?

I checked a random ICE issue (93578) and it appears that rustc is not affected, or that the rustdoc "no entry found for key" panic is special, or something.

Meta

rustcargo@zealot:/home/ian/Rustup/Arti/Build/arti$ rustdoc --version --verbose
rustdoc 1.60.0-nightly (6abb6385b 2022-01-26)
binary: rustdoc
commit-hash: 6abb6385b2cb7249f67b9b3ce7522527767dd907
commit-date: 2022-01-26
host: x86_64-unknown-linux-gnu
release: 1.60.0-nightly
LLVM version: 13.0.0
rustcargo@zealot:/home/ian/Rustup/Arti/Build/arti$ 

Not including a backtrace since there seem to be plenty of these about.

(NB this bug is not about the original panic; it is about the subsequent messages. So while #93428 is relevant since it provides a convenient repro, this bug is not the same as that one.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions