rustdoc_json: Add a test for some GenericArgs cases.
This commit is contained in:
parent
2b5fd9a307
commit
18d742bda0
1 changed files with 20 additions and 0 deletions
20
tests/rustdoc-json/generic-args.rs
Normal file
20
tests/rustdoc-json/generic-args.rs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
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" {\"angle_bracketed\":{\"args\":[],\"constraints\":[]}}
|
||||
//@ is "$.index[?(@.name=='my_fn1')].inner.function.sig.inputs[0][1].qualified_path.self_type.resolved_path.args" {\"angle_bracketed\":{\"args\":[],\"constraints\":[]}}
|
||||
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" {\"angle_bracketed\":{\"args\":[],\"constraints\":[]}}
|
||||
pub fn my_fn2(_: IntoIterator<Item = MyStruct, IntoIter = impl Clone>) {}
|
||||
|
||||
fn main() {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue