-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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: Reference to missing item with 2 glob imports #100973
Comments
Seems like a duplicate of #99513 |
I don't thinks so, as that occors with just 1 import, whereas this requires 2. Also thats for importing foreign items, whereas this happens for local items. |
Smaller version: #![feature(no_core)]
#![no_core]
mod m2 {}
pub use m2::*; {
"crate_version": null,
"external_crates": {},
"format_version": 18,
"includes_private": false,
"index": {
"0:0:1567": {
"crate_id": 0,
"id": "0:0:1567",
"inner": {"is_crate": true, "is_stripped": false, "items": ["0:2"]},
"kind": "module",
"name": "bug"
},
"0:2": {
"crate_id": 0,
"id": "0:2",
"inner": {"glob": true, "id": "0:1:1566", "name": "m2", "source": "m2"},
"kind": "import",
"name": null
}
},
"root": "0:0:1567"
} It looks like empty modules are being stripped. This also happens in the above example because both functions are named |
Caused by rust/src/librustdoc/json/conversions.rs Line 52 in eaadb89
@rustbot claim |
…n they have items. Fixes rust-lang#101103 Fixes rust-lang#100973
…GuillaumeGomez Rustdoc-Json: Retain Stripped Modules when they are imported, not when they have items Fixes rust-lang#101103 Fixes rust-lang#100973 r? `@GuillaumeGomez`
…GuillaumeGomez Rustdoc-Json: Retain Stripped Modules when they are imported, not when they have items Fixes rust-lang#101103 Fixes rust-lang#100973 r? ``@GuillaumeGomez``
…GuillaumeGomez Rustdoc-Json: Retain Stripped Modules when they are imported, not when they have items Fixes rust-lang#101103 Fixes rust-lang#100973 r? `@GuillaumeGomez`
…aumeGomez Replace `check_missing_items.py` with `jsondoclint` [zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/check_missing_items.2Epy.20Replacement.2E) check_missing_items.py was a python script that checked rustdoc json output to make sure all the Id's referenced existed in the JSON index. This PR replaces that with a rust binary (`jsondoclint`) that does the same thing. ### Motivation 1. Easier to change when `rustdoc-json-types` changes, as `jsondoclint` uses the types directly. 2. Better Errors: - Multiple Errors can be emited for a single crate - Errors can say where in JSON they occored ``` 2:2889:408 not in index or paths, but refered to at '.index."2:2888:104".inner.items[0]' 2:2890:410 not in index or paths, but refered to at '.index."2:2888:104".inner.items[1]' ``` 3. Catches more bugs. - Because matches are exaustive, all posible variants considered for enums - All Id's checked - Has already found rust-lang#101770, rust-lang#101199 and rust-lang#100973 - Id type is also checked, so the Id's in a structs fields can only be field items. 4. Allows the possibility of running from `rustdoc::json`, which we should do in a crator run at some point. cc `@CraftSpider` r? `@GuillaumeGomez`
…aumeGomez Replace `check_missing_items.py` with `jsondoclint` [zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/check_missing_items.2Epy.20Replacement.2E) check_missing_items.py was a python script that checked rustdoc json output to make sure all the Id's referenced existed in the JSON index. This PR replaces that with a rust binary (`jsondoclint`) that does the same thing. ### Motivation 1. Easier to change when `rustdoc-json-types` changes, as `jsondoclint` uses the types directly. 2. Better Errors: - Multiple Errors can be emited for a single crate - Errors can say where in JSON they occored ``` 2:2889:408 not in index or paths, but refered to at '.index."2:2888:104".inner.items[0]' 2:2890:410 not in index or paths, but refered to at '.index."2:2888:104".inner.items[1]' ``` 3. Catches more bugs. - Because matches are exaustive, all posible variants considered for enums - All Id's checked - Has already found rust-lang#101770, rust-lang#101199 and rust-lang#100973 - Id type is also checked, so the Id's in a structs fields can only be field items. 4. Allows the possibility of running from `rustdoc::json`, which we should do in a crator run at some point. cc `@CraftSpider` r? `@GuillaumeGomez`
…aumeGomez Replace `check_missing_items.py` with `jsondoclint` [zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/check_missing_items.2Epy.20Replacement.2E) check_missing_items.py was a python script that checked rustdoc json output to make sure all the Id's referenced existed in the JSON index. This PR replaces that with a rust binary (`jsondoclint`) that does the same thing. ### Motivation 1. Easier to change when `rustdoc-json-types` changes, as `jsondoclint` uses the types directly. 2. Better Errors: - Multiple Errors can be emited for a single crate - Errors can say where in JSON they occored ``` 2:2889:408 not in index or paths, but refered to at '.index."2:2888:104".inner.items[0]' 2:2890:410 not in index or paths, but refered to at '.index."2:2888:104".inner.items[1]' ``` 3. Catches more bugs. - Because matches are exaustive, all posible variants considered for enums - All Id's checked - Has already found rust-lang#101770, rust-lang#101199 and rust-lang#100973 - Id type is also checked, so the Id's in a structs fields can only be field items. 4. Allows the possibility of running from `rustdoc::json`, which we should do in a crator run at some point. cc ``@CraftSpider`` r? ``@GuillaumeGomez``
Produces an output with references to non existant items:
0:3:1564
and0:1:1563
Full
If you remove one of the imports, everything is fine
Full
This should have been caught by
check_missing_items.py
, but wasn't. Instead is was caught byjsondoclint
, a rust based replacement (PR soon).@rustbot modify labels: +A-rustdoc-json +T-rustdoc
The text was updated successfully, but these errors were encountered: