-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Labels
A-intra-doc-linksArea: Intra-doc links, the ability to link to items in docs by nameArea: Intra-doc links, the ability to link to items in docs by nameA-lang-itemArea: Language itemsArea: Language itemsA-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyC-bugCategory: This is a bug.Category: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Description
This is a regression from rustdoc 1.40.0 (73528e339 2019-12-16)
to rustdoc 1.41.0-beta.3 (fb3056216 2020-01-19)
.
If rustdoc attempts to document a crate that has at least two dependencies which implement a panic_handler
, it fails with an error similar to
error: duplicate lang item in crate `panic_halt` (which `panic2` depends on): `panic_impl`.
|
= note: first defined in crate `std` (which `panic2` depends on).
Note that the crate builds fine, it's just documenting that is broken.
Steps to reproduce
- Create a new project, e.g.
cargo new panic2
- Add a dependency on
panic-halt = "0.2.0"
, e.g.cargo add panic-halt
- Attempt to document the crate, e.g.
cargo doc
An example of the different behavior between `stable`/`beta` and `build`/`doc`.
$ cargo +stable clean
$ cargo +beta clean
$ cargo +stable build
Compiling panic-halt v0.2.0
Compiling panic2 v0.1.0 (/Users/logic/Projects/tmp/panic2)
Finished dev [unoptimized + debuginfo] target(s) in 0.35s
$ cargo +stable doc
Documenting panic-halt v0.2.0
Checking panic-halt v0.2.0
Documenting panic2 v0.1.0 (/Users/logic/Projects/tmp/panic2)
Finished dev [unoptimized + debuginfo] target(s) in 1.40s
$ cargo +beta build
Compiling panic-halt v0.2.0
Compiling panic2 v0.1.0 (/Users/logic/Projects/tmp/panic2)
Finished dev [unoptimized + debuginfo] target(s) in 0.27s
$ cargo +beta doc
Documenting panic-halt v0.2.0
Checking panic-halt v0.2.0
Documenting panic2 v0.1.0 (/Users/logic/Projects/tmp/panic2)
error: duplicate lang item in crate `panic_halt` (which `panic2` depends on): `panic_impl`.
|
= note: first defined in crate `std` (which `panic2` depends on).
error: aborting due to previous error
error: Could not document `panic2`.
Caused by:
process didn't exit successfully: `rustdoc --edition=2018 --crate-type bin --crate-name panic2 src/main.rs -o /Users/logic/Projects/tmp/panic2/target/doc --error-format=json --json=diagnostic-rendered-ansi --document-private-items -L dependency=/Users/logic/Projects/tmp/panic2/target/debug/deps --extern panic_halt=/Users/logic/Projects/tmp/panic2/target/debug/deps/libpanic_halt-6d0ca720c3c355fb.rmeta` (exit code: 1)
Metadata
Metadata
Assignees
Labels
A-intra-doc-linksArea: Intra-doc links, the ability to link to items in docs by nameArea: Intra-doc links, the ability to link to items in docs by nameA-lang-itemArea: Language itemsArea: Language itemsA-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyC-bugCategory: This is a bug.Category: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.