-
Notifications
You must be signed in to change notification settings - Fork 13k
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
[rustdoc-json] Foreign items that are only re-exported are no longer included in the index #99513
Comments
Could you exemplify what you mean please? This example code is a re-export of a foreign item, right? And that works (with mentioned limitations further down): #99287 (comment) |
Sure here is real-world case I stumble across: https://github.com/mrhooray/crc-rs/blob/4618281222223265e24772ce89f54bff45bda03c/src/lib.rs#L34 in this case there is a Minimal reproducer with your bash script
Yeah, I may have spoken to soon, if the trait |
There indeed seems to be a bug when wildcards are used. Here is a reproducer. Copy-paste to your bash shell: # Create a library with a trait with one associated function
echo '
#![feature(no_core)]
#![no_core]
#![no_std]
pub trait A {
fn trait_a_fn();
}
' > a.rs
# Create another library that depends on the first library
echo '
#![feature(no_core)]
#![no_core]
#![no_std]
pub use a::*;
' > b.rs
# Compile the library
rustc +nightly --edition=2021 --crate-type rlib a.rs
# Generate rustdoc JSON for both libraries
rustdoc +nightly --edition=2021 --extern a=liba.rlib -Z unstable-options --output-format json b.rs
# Missing "kind": "trait" item
cat doc/b.json | python3 -m json.tool There is no |
Introduce a new `external_index` that only contains a `ExternalItem` struct from the previous `ItemSummary`. This "new" index only contains external item and is only here so that IDs continue to referring to an "item". A previous version of this patch also removed `path` but at least until rust-lang#99513 is fixed it is unfortunately still required (as a workaround).
PR #99287 changed the behavior of the JSON output of rustdoc to no longer do inlining of re-export as it was causing many problems. However the new behavior do not account for foreign items that are only re-exported as they are no longer included in the index.
We should fix this by re-introducing them in the index. But how ? I tried hacking around by doing partial-inlining but this will just re-introduce the problems we has before. I someone wants to build on what I did here is the code:
cc @aDotInTheVoid @CraftSpider @Enselic
@rustbot labels +A-rustdoc-json +T-rustdoc +requires-nightly
The text was updated successfully, but these errors were encountered: