mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-04 11:17:04 +00:00

They show up in three places: once as `Option<Box<GenericArgs>>`, once as `Box<GenericArgs>`, and once as `GenericArgs`. The first option is best. It is more compact because generic args are often missing. This commit changes the latter two to the former. Example output, before and after, for the `AssocItemConstraint` change: ``` {"name":"Offset","args":{"angle_bracketed":{"args":[],"constraints":[]}},"binding":{...}} {"name":"Offset","args":null,"binding":{...}} ``` Example output, before and after, for the `Type::QualifiedPath` change: ``` {"qualified_path":{"name":"Offset","args":{"angle_bracketed":{"args":[],"constraints":[]}}, ...}} {"qualified_path":{"name":"Offset","args":null, ...}} ``` This reduces JSON output size, but not by much (e.g. 0.5%), because `AssocItemConstraint` and `Type::QualifiedPath` are uncommon.
21 lines
661 B
Rust
21 lines
661 B
Rust
pub struct MyStruct(u32);
|
|
|
|
pub trait MyTrait {
|
|
type MyType;
|
|
fn my_fn(&self);
|
|
}
|
|
|
|
impl MyTrait for MyStruct {
|
|
type MyType = u32;
|
|
fn my_fn(&self) {}
|
|
}
|
|
|
|
//@ is "$.index[?(@.name=='my_fn1')].inner.function.sig.inputs[0][1].qualified_path.args" null
|
|
//@ is "$.index[?(@.name=='my_fn1')].inner.function.sig.inputs[0][1].qualified_path.self_type.resolved_path.args" null
|
|
pub fn my_fn1(_: <MyStruct as MyTrait>::MyType) {}
|
|
|
|
//@ is "$.index[?(@.name=='my_fn2')].inner.function.sig.inputs[0][1].dyn_trait.traits[0].trait.args.angle_bracketed.constraints[0].args" null
|
|
pub fn my_fn2(_: IntoIterator<Item = MyStruct, IntoIter = impl Clone>) {}
|
|
|
|
fn main() {}
|