diff options
Diffstat (limited to 'tests/rustdoc-json/traits')
-rw-r--r-- | tests/rustdoc-json/traits/has_body.rs | 14 | ||||
-rw-r--r-- | tests/rustdoc-json/traits/implementors.rs | 10 | ||||
-rw-r--r-- | tests/rustdoc-json/traits/supertrait.rs | 16 | ||||
-rw-r--r-- | tests/rustdoc-json/traits/trait_alias.rs | 18 |
4 files changed, 29 insertions, 29 deletions
diff --git a/tests/rustdoc-json/traits/has_body.rs b/tests/rustdoc-json/traits/has_body.rs index a57cb97d4..219e2d9bc 100644 --- a/tests/rustdoc-json/traits/has_body.rs +++ b/tests/rustdoc-json/traits/has_body.rs @@ -1,21 +1,21 @@ // @has "$.index[*][?(@.name=='Foo')]" pub trait Foo { - // @is "$.index[*][?(@.name=='no_self')].inner.has_body" false + // @is "$.index[*][?(@.name=='no_self')].inner.function.has_body" false fn no_self(); - // @is "$.index[*][?(@.name=='move_self')].inner.has_body" false + // @is "$.index[*][?(@.name=='move_self')].inner.function.has_body" false fn move_self(self); - // @is "$.index[*][?(@.name=='ref_self')].inner.has_body" false + // @is "$.index[*][?(@.name=='ref_self')].inner.function.has_body" false fn ref_self(&self); - // @is "$.index[*][?(@.name=='no_self_def')].inner.has_body" true + // @is "$.index[*][?(@.name=='no_self_def')].inner.function.has_body" true fn no_self_def() {} - // @is "$.index[*][?(@.name=='move_self_def')].inner.has_body" true + // @is "$.index[*][?(@.name=='move_self_def')].inner.function.has_body" true fn move_self_def(self) {} - // @is "$.index[*][?(@.name=='ref_self_def')].inner.has_body" true + // @is "$.index[*][?(@.name=='ref_self_def')].inner.function.has_body" true fn ref_self_def(&self) {} } pub trait Bar: Clone { - // @is "$.index[*][?(@.name=='method')].inner.has_body" false + // @is "$.index[*][?(@.name=='method')].inner.function.has_body" false fn method(&self, param: usize); } diff --git a/tests/rustdoc-json/traits/implementors.rs b/tests/rustdoc-json/traits/implementors.rs index db3fe5df7..7d351ad61 100644 --- a/tests/rustdoc-json/traits/implementors.rs +++ b/tests/rustdoc-json/traits/implementors.rs @@ -2,18 +2,18 @@ #![no_core] // @set wham = "$.index[*][?(@.name=='Wham')].id" -// @count "$.index[*][?(@.name=='Wham')].inner.implementations[*]" 1 -// @set gmWham = "$.index[*][?(@.name=='Wham')].inner.implementations[0]" +// @count "$.index[*][?(@.name=='Wham')].inner.trait.implementations[*]" 1 +// @set gmWham = "$.index[*][?(@.name=='Wham')].inner.trait.implementations[0]" pub trait Wham {} -// @count "$.index[*][?(@.name=='GeorgeMichael')].inner.impls[*]" 1 -// @is "$.index[*][?(@.name=='GeorgeMichael')].inner.impls[0]" $gmWham +// @count "$.index[*][?(@.name=='GeorgeMichael')].inner.struct.impls[*]" 1 +// @is "$.index[*][?(@.name=='GeorgeMichael')].inner.struct.impls[0]" $gmWham // @set gm = "$.index[*][?(@.name=='Wham')].id" // jsonpath_lib isnt expressive enough (for now) to get the "impl" item, so we // just check it isn't pointing to the type, but when you port to jsondocck-ng // check what the impl item is -// @!is "$.index[*][?(@.name=='Wham')].inner.implementations[0]" $gm +// @!is "$.index[*][?(@.name=='Wham')].inner.trait.implementations[0]" $gm pub struct GeorgeMichael {} impl Wham for GeorgeMichael {} diff --git a/tests/rustdoc-json/traits/supertrait.rs b/tests/rustdoc-json/traits/supertrait.rs index 4048fdd74..2123ac404 100644 --- a/tests/rustdoc-json/traits/supertrait.rs +++ b/tests/rustdoc-json/traits/supertrait.rs @@ -8,19 +8,19 @@ pub trait Loud {} // @set very_loud_id = "$.index[*][?(@.name=='VeryLoud')].id" -// @count "$.index[*][?(@.name=='VeryLoud')].inner.bounds[*]" 1 -// @is "$.index[*][?(@.name=='VeryLoud')].inner.bounds[0].trait_bound.trait.id" $loud_id +// @count "$.index[*][?(@.name=='VeryLoud')].inner.trait.bounds[*]" 1 +// @is "$.index[*][?(@.name=='VeryLoud')].inner.trait.bounds[0].trait_bound.trait.id" $loud_id pub trait VeryLoud: Loud {} // @set sounds_good_id = "$.index[*][?(@.name=='SoundsGood')].id" pub trait SoundsGood {} -// @count "$.index[*][?(@.name=='MetalBand')].inner.bounds[*]" 2 -// @is "$.index[*][?(@.name=='MetalBand')].inner.bounds[0].trait_bound.trait.id" $very_loud_id -// @is "$.index[*][?(@.name=='MetalBand')].inner.bounds[1].trait_bound.trait.id" $sounds_good_id +// @count "$.index[*][?(@.name=='MetalBand')].inner.trait.bounds[*]" 2 +// @is "$.index[*][?(@.name=='MetalBand')].inner.trait.bounds[0].trait_bound.trait.id" $very_loud_id +// @is "$.index[*][?(@.name=='MetalBand')].inner.trait.bounds[1].trait_bound.trait.id" $sounds_good_id pub trait MetalBand: VeryLoud + SoundsGood {} -// @count "$.index[*][?(@.name=='DnabLatem')].inner.bounds[*]" 2 -// @is "$.index[*][?(@.name=='DnabLatem')].inner.bounds[1].trait_bound.trait.id" $very_loud_id -// @is "$.index[*][?(@.name=='DnabLatem')].inner.bounds[0].trait_bound.trait.id" $sounds_good_id +// @count "$.index[*][?(@.name=='DnabLatem')].inner.trait.bounds[*]" 2 +// @is "$.index[*][?(@.name=='DnabLatem')].inner.trait.bounds[1].trait_bound.trait.id" $very_loud_id +// @is "$.index[*][?(@.name=='DnabLatem')].inner.trait.bounds[0].trait_bound.trait.id" $sounds_good_id pub trait DnabLatem: SoundsGood + VeryLoud {} diff --git a/tests/rustdoc-json/traits/trait_alias.rs b/tests/rustdoc-json/traits/trait_alias.rs index 35db9296c..4fcc26f7d 100644 --- a/tests/rustdoc-json/traits/trait_alias.rs +++ b/tests/rustdoc-json/traits/trait_alias.rs @@ -4,24 +4,24 @@ #![feature(trait_alias)] // @set Orig = "$.index[*][?(@.name == 'Orig')].id" -// @is "$.index[*][?(@.name == 'Orig')].kind" '"trait"' +// @has "$.index[*][?(@.name == 'Orig')].inner.trait" pub trait Orig<T> {} // @set Alias = "$.index[*][?(@.name == 'Alias')].id" -// @is "$.index[*][?(@.name == 'Alias')].kind" '"trait_alias"' -// @is "$.index[*][?(@.name == 'Alias')].inner.generics" '{"params": [], "where_predicates": []}' -// @count "$.index[*][?(@.name == 'Alias')].inner.params[*]" 1 -// @is "$.index[*][?(@.name == 'Alias')].inner.params[0].trait_bound.trait.id" $Orig -// @is "$.index[*][?(@.name == 'Alias')].inner.params[0].trait_bound.trait.args.angle_bracketed.args[0].type.inner" '"i32"' +// @has "$.index[*][?(@.name == 'Alias')].inner.trait_alias" +// @is "$.index[*][?(@.name == 'Alias')].inner.trait_alias.generics" '{"params": [], "where_predicates": []}' +// @count "$.index[*][?(@.name == 'Alias')].inner.trait_alias.params[*]" 1 +// @is "$.index[*][?(@.name == 'Alias')].inner.trait_alias.params[0].trait_bound.trait.id" $Orig +// @is "$.index[*][?(@.name == 'Alias')].inner.trait_alias.params[0].trait_bound.trait.args.angle_bracketed.args[0].type.primitive" '"i32"' pub trait Alias = Orig<i32>; pub struct Struct; impl Orig<i32> for Struct {} -// @is "$.index[*][?(@.name=='takes_alias')].inner.decl.inputs[0][1].kind" '"impl_trait"' -// @is "$.index[*][?(@.name=='takes_alias')].inner.decl.inputs[0][1].inner[0].trait_bound.trait.id" $Alias -// @is "$.index[*][?(@.name=='takes_alias')].inner.generics.params[0].kind.type.bounds[0].trait_bound.trait.id" $Alias +// @has "$.index[*][?(@.name=='takes_alias')].inner.function.decl.inputs[0][1].impl_trait" +// @is "$.index[*][?(@.name=='takes_alias')].inner.function.decl.inputs[0][1].impl_trait[0].trait_bound.trait.id" $Alias +// @is "$.index[*][?(@.name=='takes_alias')].inner.function.generics.params[0].kind.type.bounds[0].trait_bound.trait.id" $Alias pub fn takes_alias(_: impl Alias) {} // FIXME: Should the trait be mentioned in both the decl and generics? |