I tried this code:
// lib.rs
#[rapx::tag]
fn f() {}
# ✅ This compiles and generates doc/
$ rustdoc lib.rs -Zcrate-attr="feature(register_tool)" -Zcrate-attr="register_tool(rapx)"
# 💥This doesn't compile
$ rustdoc --test lib.rs -Zcrate-attr="feature(register_tool)" -Zcrate-attr="register_tool(rapx)"
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `rapx`
--> lib.rs:1:3
|
1 | #[rapx::tag]
| ^^^^ use of unresolved module or unlinked crate `rapx`
I expected to see this happen: rust --test will recognize register_tool as rustdoc does.
Instead, this happened: rust --test doesn't recognize register_tool.
Meta
rustc --version --verbose:
rustc 1.89.0-nightly (45acf54ee 2025-06-16)
binary: rustc
commit-hash: 45acf54eea118ed27927282b5e0bfdcd80b7987c
commit-date: 2025-06-16
host: aarch64-unknown-linux-gnu
release: 1.89.0-nightly
LLVM version: 20.1.5
I tried this code:
I expected to see this happen:
rust --testwill recognize register_tool asrustdocdoes.Instead, this happened:
rust --testdoesn't recognize register_tool.Meta
rustc --version --verbose: