Open
Description
With the code:
#![feature(no_core)]
#![no_core]
pub trait Trait {}
pub struct Pub;
struct Priv;
impl Trait for Pub where Priv: Trait {}
fails to valididate in jsondoclint:
---- [rustdoc-json] tests/rustdoc-json/impls/private_generic_bound.rs stdout ----
error: jsondoclint failed!
status: exit status: 1
command: "/home/gh-aDotInTheVoid/rust/build/aarch64-unknown-linux-gnu/stage0-tools-bin/jsondoclint" "/home/gh-aDotInTheVoid/rust/build/aarch64-unknown-linux-gnu/test/rustdoc-json/impls/private_generic_bound/private_generic_bound.json"
stdout: none
--- stderr -------------------------------
0:4:1635 not in index or paths, but referred to at '$.index["0:6"].inner.impl.generics.where_predicates[0].bound_predicate.type.resolved_path.id'
Error: Errors validating json /home/gh-aDotInTheVoid/rust/build/aarch64-unknown-linux-gnu/test/rustdoc-json/impls/private_generic_bound/private_generic_bound.json
------------------------------------------
Because it produces (redacted)
"0:6": {
"inner": {
"impl": {
"blanket_impl": null,
"for": {"resolved_path": {"id": "0:2:1634", "name": "Pub"}},
"generics": {
"where_predicates": [
{
"bound_predicate": {
"bounds": [
{
"trait_bound": {"modifier": "none", "trait": {"id": "0:1:1633", "name": "Trait"}}
}
],
"type": {"resolved_path": {"id": "0:4:1635", "name": "Priv"}}
}
}
]
},
"is_unsafe": false,
"items": [],
"negative": false,
"provided_trait_methods": [],
"synthetic": false,
"trait": {"id": "0:1:1633", "name": "Trait"}
}
},
"name": null
}
},
This pattern comes up in practice eg:
rust/library/core/src/iter/adapters/flatten.rs
Lines 139 to 146 in a161ab0
where TrustedLen
and FlatMap
are part of core
s public API, but FlattenCompat
isn't.
HTML get's arround this by not linking to the item:
I have no idea what the right thing to do here is design-wise.