-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#[doc(hidden)]
causes type's traits to disappear from rustdoc JSON built with --document-hidden-items
#107278
Labels
A-rustdoc-json
Area: Rustdoc JSON backend
C-bug
Category: This is a bug.
S-has-mcve
Status: A Minimal Complete and Verifiable Example has been found for this issue
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
Comments
GuillaumeGomez
added
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
A-rustdoc-json
Area: Rustdoc JSON backend
labels
Jan 27, 2023
It should be fixed with #107000. |
aDotInTheVoid
added
the
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
label
Feb 3, 2023
That didn't fix it MCVE: // compile-flags: --document-private-items --document-hidden-items
#![feature(no_core)]
#![no_core]
pub trait TheTrait {}
#[doc(hidden)]
struct Value {}
impl TheTrait for Value {} Produces (On f63ccaf) "0:1:1585": {
"crate_id": 0,
"docs": null,
"id": "0:1:1585",
"inner": {
"bounds": [],
"generics": {"params": [], "where_predicates": []},
"implementations": [],
"is_auto": false,
"is_unsafe": false,
"items": []
},
"kind": "trait",
"name": "TheTrait"
},
"0:2:1586": {
"crate_id": 0,
"docs": null,
"id": "0:2:1586",
"inner": {
"generics": {"params": [], "where_predicates": []},
"impls": [],
"kind": {"plain": {"fields": [], "fields_stripped": false}}
},
"kind": "struct",
"name": "Value"
} |
aDotInTheVoid
added
S-has-mcve
Status: A Minimal Complete and Verifiable Example has been found for this issue
and removed
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
labels
Mar 6, 2023
This is fixed & works just fine as of today |
its-the-shrimp
added a commit
to its-the-shrimp/rust
that referenced
this issue
Aug 8, 2024
It would be great to make sure we have a regression test case for this
before closing the issue, since this is a correctness concern for
cargo-semver-checks that would be very difficult to debug if it reoccurs.
|
Absolutely, that's what I've done in #128836 |
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Aug 8, 2024
…, r=aDotInTheVoid rustdoc-json: add a test for impls on private & hidden types Fixes rust-lang#107278 (or rather just ensures it won't resurface) r? `@aDotInTheVoid`
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Aug 9, 2024
Rollup merge of rust-lang#128836 - its-the-shrimp:add_test_for_107278, r=aDotInTheVoid rustdoc-json: add a test for impls on private & hidden types Fixes rust-lang#107278 (or rather just ensures it won't resurface) r? ``@aDotInTheVoid``
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-rustdoc-json
Area: Rustdoc JSON backend
C-bug
Category: This is a bug.
S-has-mcve
Status: A Minimal Complete and Verifiable Example has been found for this issue
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
Affected crate:
toml_edit
, at pathcrates/toml_edit
in repo https://github.com/toml-rs/tomlCommit: d86370fc5e8777e532de457cb6569feeae6429f0
Building rustdoc JSON with
RUSTDOCFLAGS="-Z unstable-options --document-private-items --document-hidden-items --output-format=json"
Consider the following type from
crates/toml_edit/src/easy/value.rs
in that commit:I expected to see this happen: the rustdoc JSON should state that
PartialEq, Clone, Debug, Send, Sync, Unpin
etc. are all implemented for that type.Instead, this happened: none of those traits are listed as implemented for that type.
Deleting
#[doc(hidden)]
and rebuilding the rustdoc JSON causes all the missing trait impls to be present again.Meta
rustc --version --verbose
:The same bug is present on nightly:
The bug was first spotted by @epage who filed a bug report on
cargo-semver-checks
for incorrectly reporting that types stopped beingSend / Sync / Debug / Clone
etc. Of course we now know this was because those traits were genuinely not present in the underlying rustdoc JSON file.Thanks for all the awesome work you've been doing! It's been absolutely fundamental for
cargo-semver-checks
.The text was updated successfully, but these errors were encountered: