mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
rustdoc_json: Add a test for some GenericArgs cases.
This commit is contained in:
@@ -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() {}
|
||||
Reference in New Issue
Block a user