summary refs log tree commit diff
path: root/src/test/rustdoc-json/fns/generics.rs
AgeCommit message (Collapse)AuthorLines
2022-03-04rustdoc-json: Make the `fns/generics.rs` test much more robustNixon Enraght-Moony-4/+25
2022-03-04rustdoc-json: Include GenericParamDefKind::Type::synthetic in JSONMartin Nordholts-0/+5
The rustdoc JSON for ``` pub fn f(_: impl Clone) {} ``` will effectively be ``` pub fn f<impl Clone: Clone>(_: impl Clone) ``` where a synthetic generic parameter called `impl Clone` with generic trait bound `Clone` is added to the function declaration. The generated HTML filters out these generic parameters by doing `self.params.iter().filter(|p| !p.is_synthetic_type_param())`, because the synthetic generic parameter is not of interest to regular users. For the same reason, we should expose whether or not a generic parameter is synthetic or not also in the rustdoc JSON, so that rustdoc JSON clients can also have the option to hide synthetic generic parameters.