diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 02:49:50 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 02:49:50 +0000 |
commit | 9835e2ae736235810b4ea1c162ca5e65c547e770 (patch) | |
tree | 3fcebf40ed70e581d776a8a4c65923e8ec20e026 /tests/rustdoc-json/enums | |
parent | Releasing progress-linux version 1.70.0+dfsg2-1~progress7.99u1. (diff) | |
download | rustc-9835e2ae736235810b4ea1c162ca5e65c547e770.tar.xz rustc-9835e2ae736235810b4ea1c162ca5e65c547e770.zip |
Merging upstream version 1.71.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/rustdoc-json/enums')
17 files changed, 146 insertions, 142 deletions
diff --git a/tests/rustdoc-json/enums/discriminant/basic.rs b/tests/rustdoc-json/enums/discriminant/basic.rs index 06906df3b..dbfc5c2cf 100644 --- a/tests/rustdoc-json/enums/discriminant/basic.rs +++ b/tests/rustdoc-json/enums/discriminant/basic.rs @@ -1,12 +1,12 @@ #[repr(i8)] pub enum Ordering { - // @is "$.index[*][?(@.name=='Less')].inner.discriminant.expr" '"-1"' - // @is "$.index[*][?(@.name=='Less')].inner.discriminant.value" '"-1"' + // @is "$.index[*][?(@.name=='Less')].inner.variant.discriminant.expr" '"-1"' + // @is "$.index[*][?(@.name=='Less')].inner.variant.discriminant.value" '"-1"' Less = -1, - // @is "$.index[*][?(@.name=='Equal')].inner.discriminant.expr" '"0"' - // @is "$.index[*][?(@.name=='Equal')].inner.discriminant.value" '"0"' + // @is "$.index[*][?(@.name=='Equal')].inner.variant.discriminant.expr" '"0"' + // @is "$.index[*][?(@.name=='Equal')].inner.variant.discriminant.value" '"0"' Equal = 0, - // @is "$.index[*][?(@.name=='Greater')].inner.discriminant.expr" '"1"' - // @is "$.index[*][?(@.name=='Greater')].inner.discriminant.value" '"1"' + // @is "$.index[*][?(@.name=='Greater')].inner.variant.discriminant.expr" '"1"' + // @is "$.index[*][?(@.name=='Greater')].inner.variant.discriminant.value" '"1"' Greater = 1, } diff --git a/tests/rustdoc-json/enums/discriminant/expr.rs b/tests/rustdoc-json/enums/discriminant/expr.rs index e639965e7..ddcad58a5 100644 --- a/tests/rustdoc-json/enums/discriminant/expr.rs +++ b/tests/rustdoc-json/enums/discriminant/expr.rs @@ -1,30 +1,30 @@ pub enum Foo { - // @is "$.index[*][?(@.name=='Addition')].inner.discriminant.value" '"0"' - // @is "$.index[*][?(@.name=='Addition')].inner.discriminant.expr" '"{ _ }"' + // @is "$.index[*][?(@.name=='Addition')].inner.variant.discriminant.value" '"0"' + // @is "$.index[*][?(@.name=='Addition')].inner.variant.discriminant.expr" '"{ _ }"' Addition = 0 + 0, - // @is "$.index[*][?(@.name=='Bin')].inner.discriminant.value" '"1"' - // @is "$.index[*][?(@.name=='Bin')].inner.discriminant.expr" '"0b1"' + // @is "$.index[*][?(@.name=='Bin')].inner.variant.discriminant.value" '"1"' + // @is "$.index[*][?(@.name=='Bin')].inner.variant.discriminant.expr" '"0b1"' Bin = 0b1, - // @is "$.index[*][?(@.name=='Oct')].inner.discriminant.value" '"2"' - // @is "$.index[*][?(@.name=='Oct')].inner.discriminant.expr" '"0o2"' + // @is "$.index[*][?(@.name=='Oct')].inner.variant.discriminant.value" '"2"' + // @is "$.index[*][?(@.name=='Oct')].inner.variant.discriminant.expr" '"0o2"' Oct = 0o2, - // @is "$.index[*][?(@.name=='PubConst')].inner.discriminant.value" '"3"' - // @is "$.index[*][?(@.name=='PubConst')].inner.discriminant.expr" '"THREE"' + // @is "$.index[*][?(@.name=='PubConst')].inner.variant.discriminant.value" '"3"' + // @is "$.index[*][?(@.name=='PubConst')].inner.variant.discriminant.expr" '"THREE"' PubConst = THREE, - // @is "$.index[*][?(@.name=='Hex')].inner.discriminant.value" '"4"' - // @is "$.index[*][?(@.name=='Hex')].inner.discriminant.expr" '"0x4"' + // @is "$.index[*][?(@.name=='Hex')].inner.variant.discriminant.value" '"4"' + // @is "$.index[*][?(@.name=='Hex')].inner.variant.discriminant.expr" '"0x4"' Hex = 0x4, - // @is "$.index[*][?(@.name=='Cast')].inner.discriminant.value" '"5"' - // @is "$.index[*][?(@.name=='Cast')].inner.discriminant.expr" '"{ _ }"' + // @is "$.index[*][?(@.name=='Cast')].inner.variant.discriminant.value" '"5"' + // @is "$.index[*][?(@.name=='Cast')].inner.variant.discriminant.expr" '"{ _ }"' Cast = 5 as isize, - // @is "$.index[*][?(@.name=='PubCall')].inner.discriminant.value" '"6"' - // @is "$.index[*][?(@.name=='PubCall')].inner.discriminant.expr" '"{ _ }"' + // @is "$.index[*][?(@.name=='PubCall')].inner.variant.discriminant.value" '"6"' + // @is "$.index[*][?(@.name=='PubCall')].inner.variant.discriminant.expr" '"{ _ }"' PubCall = six(), - // @is "$.index[*][?(@.name=='PrivCall')].inner.discriminant.value" '"7"' - // @is "$.index[*][?(@.name=='PrivCall')].inner.discriminant.expr" '"{ _ }"' + // @is "$.index[*][?(@.name=='PrivCall')].inner.variant.discriminant.value" '"7"' + // @is "$.index[*][?(@.name=='PrivCall')].inner.variant.discriminant.expr" '"{ _ }"' PrivCall = seven(), - // @is "$.index[*][?(@.name=='PrivConst')].inner.discriminant.value" '"8"' - // @is "$.index[*][?(@.name=='PrivConst')].inner.discriminant.expr" '"EIGHT"' + // @is "$.index[*][?(@.name=='PrivConst')].inner.variant.discriminant.value" '"8"' + // @is "$.index[*][?(@.name=='PrivConst')].inner.variant.discriminant.expr" '"EIGHT"' PrivConst = EIGHT, } diff --git a/tests/rustdoc-json/enums/discriminant/limits.rs b/tests/rustdoc-json/enums/discriminant/limits.rs index e56d5594f..47fb70408 100644 --- a/tests/rustdoc-json/enums/discriminant/limits.rs +++ b/tests/rustdoc-json/enums/discriminant/limits.rs @@ -4,40 +4,40 @@ #[repr(u64)] pub enum U64 { - // @is "$.index[*][?(@.name=='U64Min')].inner.discriminant.value" '"0"' - // @is "$.index[*][?(@.name=='U64Min')].inner.discriminant.expr" '"u64::MIN"' + // @is "$.index[*][?(@.name=='U64Min')].inner.variant.discriminant.value" '"0"' + // @is "$.index[*][?(@.name=='U64Min')].inner.variant.discriminant.expr" '"u64::MIN"' U64Min = u64::MIN, - // @is "$.index[*][?(@.name=='U64Max')].inner.discriminant.value" '"18446744073709551615"' - // @is "$.index[*][?(@.name=='U64Max')].inner.discriminant.expr" '"u64::MAX"' + // @is "$.index[*][?(@.name=='U64Max')].inner.variant.discriminant.value" '"18446744073709551615"' + // @is "$.index[*][?(@.name=='U64Max')].inner.variant.discriminant.expr" '"u64::MAX"' U64Max = u64::MAX, } #[repr(i64)] pub enum I64 { - // @is "$.index[*][?(@.name=='I64Min')].inner.discriminant.value" '"-9223372036854775808"' - // @is "$.index[*][?(@.name=='I64Min')].inner.discriminant.expr" '"i64::MIN"' + // @is "$.index[*][?(@.name=='I64Min')].inner.variant.discriminant.value" '"-9223372036854775808"' + // @is "$.index[*][?(@.name=='I64Min')].inner.variant.discriminant.expr" '"i64::MIN"' I64Min = i64::MIN, - // @is "$.index[*][?(@.name=='I64Max')].inner.discriminant.value" '"9223372036854775807"' - // @is "$.index[*][?(@.name=='I64Max')].inner.discriminant.expr" '"i64::MAX"' + // @is "$.index[*][?(@.name=='I64Max')].inner.variant.discriminant.value" '"9223372036854775807"' + // @is "$.index[*][?(@.name=='I64Max')].inner.variant.discriminant.expr" '"i64::MAX"' I64Max = i64::MAX, } #[repr(u128)] pub enum U128 { - // @is "$.index[*][?(@.name=='U128Min')].inner.discriminant.value" '"0"' - // @is "$.index[*][?(@.name=='U128Min')].inner.discriminant.expr" '"u128::MIN"' + // @is "$.index[*][?(@.name=='U128Min')].inner.variant.discriminant.value" '"0"' + // @is "$.index[*][?(@.name=='U128Min')].inner.variant.discriminant.expr" '"u128::MIN"' U128Min = u128::MIN, - // @is "$.index[*][?(@.name=='U128Max')].inner.discriminant.value" '"340282366920938463463374607431768211455"' - // @is "$.index[*][?(@.name=='U128Max')].inner.discriminant.expr" '"u128::MAX"' + // @is "$.index[*][?(@.name=='U128Max')].inner.variant.discriminant.value" '"340282366920938463463374607431768211455"' + // @is "$.index[*][?(@.name=='U128Max')].inner.variant.discriminant.expr" '"u128::MAX"' U128Max = u128::MAX, } #[repr(i128)] pub enum I128 { - // @is "$.index[*][?(@.name=='I128Min')].inner.discriminant.value" '"-170141183460469231731687303715884105728"' - // @is "$.index[*][?(@.name=='I128Min')].inner.discriminant.expr" '"i128::MIN"' + // @is "$.index[*][?(@.name=='I128Min')].inner.variant.discriminant.value" '"-170141183460469231731687303715884105728"' + // @is "$.index[*][?(@.name=='I128Min')].inner.variant.discriminant.expr" '"i128::MIN"' I128Min = i128::MIN, - // @is "$.index[*][?(@.name=='I128Max')].inner.discriminant.value" '"170141183460469231731687303715884105727"' - // @is "$.index[*][?(@.name=='I128Max')].inner.discriminant.expr" '"i128::MAX"' + // @is "$.index[*][?(@.name=='I128Max')].inner.variant.discriminant.value" '"170141183460469231731687303715884105727"' + // @is "$.index[*][?(@.name=='I128Max')].inner.variant.discriminant.expr" '"i128::MAX"' I128Max = i128::MAX, } diff --git a/tests/rustdoc-json/enums/discriminant/num_underscore_and_suffix.rs b/tests/rustdoc-json/enums/discriminant/num_underscore_and_suffix.rs index 6889b305f..9c3db81c6 100644 --- a/tests/rustdoc-json/enums/discriminant/num_underscore_and_suffix.rs +++ b/tests/rustdoc-json/enums/discriminant/num_underscore_and_suffix.rs @@ -1,15 +1,17 @@ +// ignore-tidy-linelength + #[repr(u32)] pub enum Foo { - // @is "$.index[*][?(@.name=='Basic')].inner.discriminant.value" '"0"' - // @is "$.index[*][?(@.name=='Basic')].inner.discriminant.expr" '"0"' + // @is "$.index[*][?(@.name=='Basic')].inner.variant.discriminant.value" '"0"' + // @is "$.index[*][?(@.name=='Basic')].inner.variant.discriminant.expr" '"0"' Basic = 0, - // @is "$.index[*][?(@.name=='Suffix')].inner.discriminant.value" '"10"' - // @is "$.index[*][?(@.name=='Suffix')].inner.discriminant.expr" '"10u32"' + // @is "$.index[*][?(@.name=='Suffix')].inner.variant.discriminant.value" '"10"' + // @is "$.index[*][?(@.name=='Suffix')].inner.variant.discriminant.expr" '"10u32"' Suffix = 10u32, - // @is "$.index[*][?(@.name=='Underscore')].inner.discriminant.value" '"100"' - // @is "$.index[*][?(@.name=='Underscore')].inner.discriminant.expr" '"1_0_0"' + // @is "$.index[*][?(@.name=='Underscore')].inner.variant.discriminant.value" '"100"' + // @is "$.index[*][?(@.name=='Underscore')].inner.variant.discriminant.expr" '"1_0_0"' Underscore = 1_0_0, - // @is "$.index[*][?(@.name=='SuffixUnderscore')].inner.discriminant.value" '"1000"' - // @is "$.index[*][?(@.name=='SuffixUnderscore')].inner.discriminant.expr" '"1_0_0_0u32"' + // @is "$.index[*][?(@.name=='SuffixUnderscore')].inner.variant.discriminant.value" '"1000"' + // @is "$.index[*][?(@.name=='SuffixUnderscore')].inner.variant.discriminant.expr" '"1_0_0_0u32"' SuffixUnderscore = 1_0_0_0u32, } diff --git a/tests/rustdoc-json/enums/discriminant/only_some_have_discriminant.rs b/tests/rustdoc-json/enums/discriminant/only_some_have_discriminant.rs index 6a4f54de6..38ba1caf1 100644 --- a/tests/rustdoc-json/enums/discriminant/only_some_have_discriminant.rs +++ b/tests/rustdoc-json/enums/discriminant/only_some_have_discriminant.rs @@ -1,10 +1,12 @@ +// ignore-tidy-linelength + pub enum Foo { - // @is "$.index[*][?(@.name=='Has')].inner.discriminant" '{"expr":"0", "value":"0"}' + // @is "$.index[*][?(@.name=='Has')].inner.variant.discriminant" '{"expr":"0", "value":"0"}' Has = 0, - // @is "$.index[*][?(@.name=='Doesnt')].inner.discriminant" null + // @is "$.index[*][?(@.name=='Doesnt')].inner.variant.discriminant" null Doesnt, - // @is "$.index[*][?(@.name=='AlsoDoesnt')].inner.discriminant" null + // @is "$.index[*][?(@.name=='AlsoDoesnt')].inner.variant.discriminant" null AlsoDoesnt, - // @is "$.index[*][?(@.name=='AlsoHas')].inner.discriminant" '{"expr":"44", "value":"44"}' + // @is "$.index[*][?(@.name=='AlsoHas')].inner.variant.discriminant" '{"expr":"44", "value":"44"}' AlsoHas = 44, } diff --git a/tests/rustdoc-json/enums/discriminant/struct.rs b/tests/rustdoc-json/enums/discriminant/struct.rs index e91a632a3..c4b087c36 100644 --- a/tests/rustdoc-json/enums/discriminant/struct.rs +++ b/tests/rustdoc-json/enums/discriminant/struct.rs @@ -3,13 +3,13 @@ #[repr(i32)] // @is "$.index[*][?(@.name=='Foo')].attrs" '["#[repr(i32)]"]' pub enum Foo { - // @is "$.index[*][?(@.name=='Struct')].inner.discriminant" null - // @count "$.index[*][?(@.name=='Struct')].inner.kind.struct.fields[*]" 0 + // @is "$.index[*][?(@.name=='Struct')].inner.variant.discriminant" null + // @count "$.index[*][?(@.name=='Struct')].inner.variant.kind.struct.fields[*]" 0 Struct {}, - // @is "$.index[*][?(@.name=='StructWithDiscr')].inner.discriminant" '{"expr": "42", "value": "42"}' - // @count "$.index[*][?(@.name=='StructWithDiscr')].inner.kind.struct.fields[*]" 1 + // @is "$.index[*][?(@.name=='StructWithDiscr')].inner.variant.discriminant" '{"expr": "42", "value": "42"}' + // @count "$.index[*][?(@.name=='StructWithDiscr')].inner.variant.kind.struct.fields[*]" 1 StructWithDiscr { x: i32 } = 42, - // @is "$.index[*][?(@.name=='StructWithHexDiscr')].inner.discriminant" '{"expr": "0x42", "value": "66"}' - // @count "$.index[*][?(@.name=='StructWithHexDiscr')].inner.kind.struct.fields[*]" 2 + // @is "$.index[*][?(@.name=='StructWithHexDiscr')].inner.variant.discriminant" '{"expr": "0x42", "value": "66"}' + // @count "$.index[*][?(@.name=='StructWithHexDiscr')].inner.variant.kind.struct.fields[*]" 2 StructWithHexDiscr { x: i32, y: bool } = 0x42, } diff --git a/tests/rustdoc-json/enums/discriminant/tuple.rs b/tests/rustdoc-json/enums/discriminant/tuple.rs index b94d5739e..7da82ec8e 100644 --- a/tests/rustdoc-json/enums/discriminant/tuple.rs +++ b/tests/rustdoc-json/enums/discriminant/tuple.rs @@ -3,13 +3,13 @@ #[repr(u32)] // @is "$.index[*][?(@.name=='Foo')].attrs" '["#[repr(u32)]"]' pub enum Foo { - // @is "$.index[*][?(@.name=='Tuple')].inner.discriminant" null - // @count "$.index[*][?(@.name=='Tuple')].inner.kind.tuple[*]" 0 + // @is "$.index[*][?(@.name=='Tuple')].inner.variant.discriminant" null + // @count "$.index[*][?(@.name=='Tuple')].inner.variant.kind.tuple[*]" 0 Tuple(), - // @is "$.index[*][?(@.name=='TupleWithDiscr')].inner.discriminant" '{"expr": "1", "value": "1"}' - // @count "$.index[*][?(@.name=='TupleWithDiscr')].inner.kind.tuple[*]" 1 + // @is "$.index[*][?(@.name=='TupleWithDiscr')].inner.variant.discriminant" '{"expr": "1", "value": "1"}' + // @count "$.index[*][?(@.name=='TupleWithDiscr')].inner.variant.kind.tuple[*]" 1 TupleWithDiscr(i32) = 1, - // @is "$.index[*][?(@.name=='TupleWithBinDiscr')].inner.discriminant" '{"expr": "0b10", "value": "2"}' - // @count "$.index[*][?(@.name=='TupleWithBinDiscr')].inner.kind.tuple[*]" 2 + // @is "$.index[*][?(@.name=='TupleWithBinDiscr')].inner.variant.discriminant" '{"expr": "0b10", "value": "2"}' + // @count "$.index[*][?(@.name=='TupleWithBinDiscr')].inner.variant.kind.tuple[*]" 2 TupleWithBinDiscr(i32, i32) = 0b10, } diff --git a/tests/rustdoc-json/enums/doc_link_to_foreign_variant.rs b/tests/rustdoc-json/enums/doc_link_to_foreign_variant.rs index 470b195a2..b00156124 100644 --- a/tests/rustdoc-json/enums/doc_link_to_foreign_variant.rs +++ b/tests/rustdoc-json/enums/doc_link_to_foreign_variant.rs @@ -5,7 +5,7 @@ extern crate color; use color::Color::Red; -// @set red = "$.index[*][?(@.inner.is_crate == true)].links.Red" +// @set red = "$.index[*][?(@.inner.module.is_crate)].links.Red" // @!has "$.index[*][?(@.name == 'Red')]" // @!has "$.index[*][?(@.name == 'Color')]" diff --git a/tests/rustdoc-json/enums/field_hidden.rs b/tests/rustdoc-json/enums/field_hidden.rs index 78a054314..5c0d0ffd3 100644 --- a/tests/rustdoc-json/enums/field_hidden.rs +++ b/tests/rustdoc-json/enums/field_hidden.rs @@ -5,8 +5,8 @@ // @has "$.index[*][?(@.name=='ParseError')]" // @has "$.index[*][?(@.name=='UnexpectedEndTag')]" -// @is "$.index[*][?(@.name=='UnexpectedEndTag')].inner.kind.tuple" [null] -// @is "$.index[*][?(@.name=='UnexpectedEndTag')].inner.discriminant" null +// @is "$.index[*][?(@.name=='UnexpectedEndTag')].inner.variant.kind.tuple" [null] +// @is "$.index[*][?(@.name=='UnexpectedEndTag')].inner.variant.discriminant" null pub enum ParseError { UnexpectedEndTag(#[doc(hidden)] u32), diff --git a/tests/rustdoc-json/enums/kind.rs b/tests/rustdoc-json/enums/kind.rs index 1787a859c..e283c0740 100644 --- a/tests/rustdoc-json/enums/kind.rs +++ b/tests/rustdoc-json/enums/kind.rs @@ -5,28 +5,28 @@ pub enum Foo { // @set Unit = "$.index[*][?(@.name=='Unit')].id" - // @is "$.index[*][?(@.name=='Unit')].inner.kind" '"plain"' + // @is "$.index[*][?(@.name=='Unit')].inner.variant.kind" '"plain"' Unit, // @set Named = "$.index[*][?(@.name=='Named')].id" - // @is "$.index[*][?(@.name=='Named')].inner.kind.struct" '{"fields": [], "fields_stripped": false}' + // @is "$.index[*][?(@.name=='Named')].inner.variant.kind.struct" '{"fields": [], "fields_stripped": false}' Named {}, // @set Tuple = "$.index[*][?(@.name=='Tuple')].id" - // @is "$.index[*][?(@.name=='Tuple')].inner.kind.tuple" [] + // @is "$.index[*][?(@.name=='Tuple')].inner.variant.kind.tuple" [] Tuple(), // @set NamedField = "$.index[*][?(@.name=='NamedField')].id" - // @set x = "$.index[*][?(@.name=='x' && @.kind=='struct_field')].id" - // @is "$.index[*][?(@.name=='NamedField')].inner.kind.struct.fields[*]" $x - // @is "$.index[*][?(@.name=='NamedField')].inner.kind.struct.fields_stripped" false + // @set x = "$.index[*][?(@.name=='x' && @.inner.struct_field)].id" + // @is "$.index[*][?(@.name=='NamedField')].inner.variant.kind.struct.fields[*]" $x + // @is "$.index[*][?(@.name=='NamedField')].inner.variant.kind.struct.fields_stripped" false NamedField { x: i32 }, // @set TupleField = "$.index[*][?(@.name=='TupleField')].id" - // @set tup_field = "$.index[*][?(@.name=='0' && @.kind=='struct_field')].id" - // @is "$.index[*][?(@.name=='TupleField')].inner.kind.tuple[*]" $tup_field + // @set tup_field = "$.index[*][?(@.name=='0' && @.inner.struct_field)].id" + // @is "$.index[*][?(@.name=='TupleField')].inner.variant.kind.tuple[*]" $tup_field TupleField(i32), } -// @is "$.index[*][?(@.name=='Foo')].inner.variants[0]" $Unit -// @is "$.index[*][?(@.name=='Foo')].inner.variants[1]" $Named -// @is "$.index[*][?(@.name=='Foo')].inner.variants[2]" $Tuple -// @is "$.index[*][?(@.name=='Foo')].inner.variants[3]" $NamedField -// @is "$.index[*][?(@.name=='Foo')].inner.variants[4]" $TupleField -// @count "$.index[*][?(@.name=='Foo')].inner.variants[*]" 5 +// @is "$.index[*][?(@.name=='Foo')].inner.enum.variants[0]" $Unit +// @is "$.index[*][?(@.name=='Foo')].inner.enum.variants[1]" $Named +// @is "$.index[*][?(@.name=='Foo')].inner.enum.variants[2]" $Tuple +// @is "$.index[*][?(@.name=='Foo')].inner.enum.variants[3]" $NamedField +// @is "$.index[*][?(@.name=='Foo')].inner.enum.variants[4]" $TupleField +// @count "$.index[*][?(@.name=='Foo')].inner.enum.variants[*]" 5 diff --git a/tests/rustdoc-json/enums/struct_field_hidden.rs b/tests/rustdoc-json/enums/struct_field_hidden.rs index de939cde2..2676c4e41 100644 --- a/tests/rustdoc-json/enums/struct_field_hidden.rs +++ b/tests/rustdoc-json/enums/struct_field_hidden.rs @@ -9,8 +9,8 @@ pub enum Foo { // @set y = "$.index[*][?(@.name=='y')].id" y: i32, }, - // @is "$.index[*][?(@.name=='Variant')].inner.kind.struct.fields_stripped" true - // @is "$.index[*][?(@.name=='Variant')].inner.kind.struct.fields[0]" $b - // @is "$.index[*][?(@.name=='Variant')].inner.kind.struct.fields[1]" $y - // @count "$.index[*][?(@.name=='Variant')].inner.kind.struct.fields[*]" 2 + // @is "$.index[*][?(@.name=='Variant')].inner.variant.kind.struct.fields_stripped" true + // @is "$.index[*][?(@.name=='Variant')].inner.variant.kind.struct.fields[0]" $b + // @is "$.index[*][?(@.name=='Variant')].inner.variant.kind.struct.fields[1]" $y + // @count "$.index[*][?(@.name=='Variant')].inner.variant.kind.struct.fields[*]" 2 } diff --git a/tests/rustdoc-json/enums/tuple_fields_hidden.rs b/tests/rustdoc-json/enums/tuple_fields_hidden.rs index 70bfbb818..3aeb03564 100644 --- a/tests/rustdoc-json/enums/tuple_fields_hidden.rs +++ b/tests/rustdoc-json/enums/tuple_fields_hidden.rs @@ -14,47 +14,47 @@ // @set 3.3.1 = "$.index[*][?(@.docs=='3.3.1')].id" pub enum EnumWithStrippedTupleVariants { - // @count "$.index[*][?(@.name=='None')].inner.kind.tuple[*]" 0 + // @count "$.index[*][?(@.name=='None')].inner.variant.kind.tuple[*]" 0 None(), - // @count "$.index[*][?(@.name=='One')].inner.kind.tuple[*]" 1 - // @is "$.index[*][?(@.name=='One')].inner.kind.tuple[0]" $1.1.0 + // @count "$.index[*][?(@.name=='One')].inner.variant.kind.tuple[*]" 1 + // @is "$.index[*][?(@.name=='One')].inner.variant.kind.tuple[0]" $1.1.0 One(/** 1.1.0*/ bool), - // @count "$.index[*][?(@.name=='OneHidden')].inner.kind.tuple[*]" 1 - // @is "$.index[*][?(@.name=='OneHidden')].inner.kind.tuple[0]" null + // @count "$.index[*][?(@.name=='OneHidden')].inner.variant.kind.tuple[*]" 1 + // @is "$.index[*][?(@.name=='OneHidden')].inner.variant.kind.tuple[0]" null OneHidden(#[doc(hidden)] bool), - // @count "$.index[*][?(@.name=='Two')].inner.kind.tuple[*]" 2 - // @is "$.index[*][?(@.name=='Two')].inner.kind.tuple[0]" $2.1.0 - // @is "$.index[*][?(@.name=='Two')].inner.kind.tuple[1]" $2.1.1 + // @count "$.index[*][?(@.name=='Two')].inner.variant.kind.tuple[*]" 2 + // @is "$.index[*][?(@.name=='Two')].inner.variant.kind.tuple[0]" $2.1.0 + // @is "$.index[*][?(@.name=='Two')].inner.variant.kind.tuple[1]" $2.1.1 Two(/** 2.1.0*/ bool, /** 2.1.1*/ bool), - // @count "$.index[*][?(@.name=='TwoLeftHidden')].inner.kind.tuple[*]" 2 - // @is "$.index[*][?(@.name=='TwoLeftHidden')].inner.kind.tuple[0]" null - // @is "$.index[*][?(@.name=='TwoLeftHidden')].inner.kind.tuple[1]" $2.2.1 + // @count "$.index[*][?(@.name=='TwoLeftHidden')].inner.variant.kind.tuple[*]" 2 + // @is "$.index[*][?(@.name=='TwoLeftHidden')].inner.variant.kind.tuple[0]" null + // @is "$.index[*][?(@.name=='TwoLeftHidden')].inner.variant.kind.tuple[1]" $2.2.1 TwoLeftHidden(#[doc(hidden)] bool, /** 2.2.1*/ bool), - // @count "$.index[*][?(@.name=='TwoRightHidden')].inner.kind.tuple[*]" 2 - // @is "$.index[*][?(@.name=='TwoRightHidden')].inner.kind.tuple[0]" $2.3.0 - // @is "$.index[*][?(@.name=='TwoRightHidden')].inner.kind.tuple[1]" null + // @count "$.index[*][?(@.name=='TwoRightHidden')].inner.variant.kind.tuple[*]" 2 + // @is "$.index[*][?(@.name=='TwoRightHidden')].inner.variant.kind.tuple[0]" $2.3.0 + // @is "$.index[*][?(@.name=='TwoRightHidden')].inner.variant.kind.tuple[1]" null TwoRightHidden(/** 2.3.0*/ bool, #[doc(hidden)] bool), - // @count "$.index[*][?(@.name=='TwoBothHidden')].inner.kind.tuple[*]" 2 - // @is "$.index[*][?(@.name=='TwoBothHidden')].inner.kind.tuple[0]" null - // @is "$.index[*][?(@.name=='TwoBothHidden')].inner.kind.tuple[1]" null + // @count "$.index[*][?(@.name=='TwoBothHidden')].inner.variant.kind.tuple[*]" 2 + // @is "$.index[*][?(@.name=='TwoBothHidden')].inner.variant.kind.tuple[0]" null + // @is "$.index[*][?(@.name=='TwoBothHidden')].inner.variant.kind.tuple[1]" null TwoBothHidden(#[doc(hidden)] bool, #[doc(hidden)] bool), - // @count "$.index[*][?(@.name=='Three1')].inner.kind.tuple[*]" 3 - // @is "$.index[*][?(@.name=='Three1')].inner.kind.tuple[0]" null - // @is "$.index[*][?(@.name=='Three1')].inner.kind.tuple[1]" $3.1.1 - // @is "$.index[*][?(@.name=='Three1')].inner.kind.tuple[2]" $3.1.2 + // @count "$.index[*][?(@.name=='Three1')].inner.variant.kind.tuple[*]" 3 + // @is "$.index[*][?(@.name=='Three1')].inner.variant.kind.tuple[0]" null + // @is "$.index[*][?(@.name=='Three1')].inner.variant.kind.tuple[1]" $3.1.1 + // @is "$.index[*][?(@.name=='Three1')].inner.variant.kind.tuple[2]" $3.1.2 Three1(#[doc(hidden)] bool, /** 3.1.1*/ bool, /** 3.1.2*/ bool), - // @count "$.index[*][?(@.name=='Three2')].inner.kind.tuple[*]" 3 - // @is "$.index[*][?(@.name=='Three2')].inner.kind.tuple[0]" $3.2.0 - // @is "$.index[*][?(@.name=='Three2')].inner.kind.tuple[1]" null - // @is "$.index[*][?(@.name=='Three2')].inner.kind.tuple[2]" $3.2.2 + // @count "$.index[*][?(@.name=='Three2')].inner.variant.kind.tuple[*]" 3 + // @is "$.index[*][?(@.name=='Three2')].inner.variant.kind.tuple[0]" $3.2.0 + // @is "$.index[*][?(@.name=='Three2')].inner.variant.kind.tuple[1]" null + // @is "$.index[*][?(@.name=='Three2')].inner.variant.kind.tuple[2]" $3.2.2 Three2(/** 3.2.0*/ bool, #[doc(hidden)] bool, /** 3.2.2*/ bool), - // @count "$.index[*][?(@.name=='Three3')].inner.kind.tuple[*]" 3 - // @is "$.index[*][?(@.name=='Three3')].inner.kind.tuple[0]" $3.3.0 - // @is "$.index[*][?(@.name=='Three3')].inner.kind.tuple[1]" $3.3.1 - // @is "$.index[*][?(@.name=='Three3')].inner.kind.tuple[2]" null + // @count "$.index[*][?(@.name=='Three3')].inner.variant.kind.tuple[*]" 3 + // @is "$.index[*][?(@.name=='Three3')].inner.variant.kind.tuple[0]" $3.3.0 + // @is "$.index[*][?(@.name=='Three3')].inner.variant.kind.tuple[1]" $3.3.1 + // @is "$.index[*][?(@.name=='Three3')].inner.variant.kind.tuple[2]" null Three3(/** 3.3.0*/ bool, /** 3.3.1*/ bool, #[doc(hidden)] bool), } @@ -70,14 +70,14 @@ pub enum EnumWithStrippedTupleVariants { // @is "$.index[*][?(@.docs=='3.3.0')].name" '"0"' // @is "$.index[*][?(@.docs=='3.3.1')].name" '"1"' -// @is "$.index[*][?(@.docs=='1.1.0')].inner" '{"kind": "primitive", "inner": "bool"}' -// @is "$.index[*][?(@.docs=='2.1.0')].inner" '{"kind": "primitive", "inner": "bool"}' -// @is "$.index[*][?(@.docs=='2.1.1')].inner" '{"kind": "primitive", "inner": "bool"}' -// @is "$.index[*][?(@.docs=='2.2.1')].inner" '{"kind": "primitive", "inner": "bool"}' -// @is "$.index[*][?(@.docs=='2.3.0')].inner" '{"kind": "primitive", "inner": "bool"}' -// @is "$.index[*][?(@.docs=='3.1.1')].inner" '{"kind": "primitive", "inner": "bool"}' -// @is "$.index[*][?(@.docs=='3.1.2')].inner" '{"kind": "primitive", "inner": "bool"}' -// @is "$.index[*][?(@.docs=='3.2.0')].inner" '{"kind": "primitive", "inner": "bool"}' -// @is "$.index[*][?(@.docs=='3.2.2')].inner" '{"kind": "primitive", "inner": "bool"}' -// @is "$.index[*][?(@.docs=='3.3.0')].inner" '{"kind": "primitive", "inner": "bool"}' -// @is "$.index[*][?(@.docs=='3.3.1')].inner" '{"kind": "primitive", "inner": "bool"}' +// @is "$.index[*][?(@.docs=='1.1.0')].inner.struct_field" '{"primitive": "bool"}' +// @is "$.index[*][?(@.docs=='2.1.0')].inner.struct_field" '{"primitive": "bool"}' +// @is "$.index[*][?(@.docs=='2.1.1')].inner.struct_field" '{"primitive": "bool"}' +// @is "$.index[*][?(@.docs=='2.2.1')].inner.struct_field" '{"primitive": "bool"}' +// @is "$.index[*][?(@.docs=='2.3.0')].inner.struct_field" '{"primitive": "bool"}' +// @is "$.index[*][?(@.docs=='3.1.1')].inner.struct_field" '{"primitive": "bool"}' +// @is "$.index[*][?(@.docs=='3.1.2')].inner.struct_field" '{"primitive": "bool"}' +// @is "$.index[*][?(@.docs=='3.2.0')].inner.struct_field" '{"primitive": "bool"}' +// @is "$.index[*][?(@.docs=='3.2.2')].inner.struct_field" '{"primitive": "bool"}' +// @is "$.index[*][?(@.docs=='3.3.0')].inner.struct_field" '{"primitive": "bool"}' +// @is "$.index[*][?(@.docs=='3.3.1')].inner.struct_field" '{"primitive": "bool"}' diff --git a/tests/rustdoc-json/enums/use_glob.rs b/tests/rustdoc-json/enums/use_glob.rs index 62b8b832a..49990ec53 100644 --- a/tests/rustdoc-json/enums/use_glob.rs +++ b/tests/rustdoc-json/enums/use_glob.rs @@ -10,9 +10,9 @@ pub enum Color { Blue, } -// @set use_Color = "$.index[*][?(@.kind == 'import')].id" -// @is "$.index[*][?(@.kind == 'import')].inner.id" $Color -// @is "$.index[*][?(@.kind == 'import')].inner.glob" true +// @set use_Color = "$.index[*][?(@.inner.import)].id" +// @is "$.index[*][?(@.inner.import)].inner.import.id" $Color +// @is "$.index[*][?(@.inner.import)].inner.import.glob" true pub use Color::*; -// @ismany "$.index[*][?(@.name == 'use_glob')].inner.items[*]" $Color $use_Color +// @ismany "$.index[*][?(@.name == 'use_glob')].inner.module.items[*]" $Color $use_Color diff --git a/tests/rustdoc-json/enums/use_variant.rs b/tests/rustdoc-json/enums/use_variant.rs index 5f0d2b9b1..8190e1cbe 100644 --- a/tests/rustdoc-json/enums/use_variant.rs +++ b/tests/rustdoc-json/enums/use_variant.rs @@ -6,10 +6,10 @@ pub enum AlwaysNone { // @set None = "$.index[*][?(@.name == 'None')].id" None, } -// @is "$.index[*][?(@.name == 'AlwaysNone')].inner.variants[*]" $None +// @is "$.index[*][?(@.name == 'AlwaysNone')].inner.enum.variants[*]" $None -// @set use_None = "$.index[*][?(@.kind == 'import')].id" -// @is "$.index[*][?(@.kind == 'import')].inner.id" $None +// @set use_None = "$.index[*][?(@.inner.import)].id" +// @is "$.index[*][?(@.inner.import)].inner.import.id" $None pub use AlwaysNone::None; -// @ismany "$.index[*][?(@.name == 'use_variant')].inner.items[*]" $AlwaysNone $use_None +// @ismany "$.index[*][?(@.name == 'use_variant')].inner.module.items[*]" $AlwaysNone $use_None diff --git a/tests/rustdoc-json/enums/use_variant_foreign.rs b/tests/rustdoc-json/enums/use_variant_foreign.rs index 11bb6ce1f..a79e899d8 100644 --- a/tests/rustdoc-json/enums/use_variant_foreign.rs +++ b/tests/rustdoc-json/enums/use_variant_foreign.rs @@ -2,7 +2,7 @@ extern crate color; -// @is "$.index[*][?(@.inner.name == 'Red')].kind" '"import"' +// @has "$.index[*].inner.import[?(@.name == 'Red')]" pub use color::Color::Red; // @!has "$.index[*][?(@.name == 'Red')]" diff --git a/tests/rustdoc-json/enums/variant_struct.rs b/tests/rustdoc-json/enums/variant_struct.rs index bc870c502..fe40f1a5d 100644 --- a/tests/rustdoc-json/enums/variant_struct.rs +++ b/tests/rustdoc-json/enums/variant_struct.rs @@ -1,10 +1,10 @@ // @is "$.index[*][?(@.name=='EnumStruct')].visibility" \"public\" -// @is "$.index[*][?(@.name=='EnumStruct')].kind" \"enum\" +// @has "$.index[*][?(@.name=='EnumStruct')].inner.enum" pub enum EnumStruct { - // @is "$.index[*][?(@.name=='x')].kind" \"struct_field\" + // @has "$.index[*][?(@.name=='x')].inner.struct_field" // @set x = "$.index[*][?(@.name=='x')].id" - // @is "$.index[*][?(@.name=='y')].kind" \"struct_field\" + // @has "$.index[*][?(@.name=='y')].inner.struct_field" // @set y = "$.index[*][?(@.name=='y')].id" - // @ismany "$.index[*][?(@.name=='VariantS')].inner.kind.struct.fields[*]" $x $y + // @ismany "$.index[*][?(@.name=='VariantS')].inner.variant.kind.struct.fields[*]" $x $y VariantS { x: u32, y: String }, } diff --git a/tests/rustdoc-json/enums/variant_tuple_struct.rs b/tests/rustdoc-json/enums/variant_tuple_struct.rs index d1207bbfb..358fc1079 100644 --- a/tests/rustdoc-json/enums/variant_tuple_struct.rs +++ b/tests/rustdoc-json/enums/variant_tuple_struct.rs @@ -1,10 +1,10 @@ // @is "$.index[*][?(@.name=='EnumTupleStruct')].visibility" \"public\" -// @is "$.index[*][?(@.name=='EnumTupleStruct')].kind" \"enum\" +// @has "$.index[*][?(@.name=='EnumTupleStruct')].inner.enum" pub enum EnumTupleStruct { - // @is "$.index[*][?(@.name=='0')].kind" \"struct_field\" + // @has "$.index[*][?(@.name=='0')].inner.struct_field" // @set f0 = "$.index[*][?(@.name=='0')].id" - // @is "$.index[*][?(@.name=='1')].kind" \"struct_field\" + // @has "$.index[*][?(@.name=='1')].inner.struct_field" // @set f1 = "$.index[*][?(@.name=='1')].id" - // @ismany "$.index[*][?(@.name=='VariantA')].inner.kind.tuple[*]" $f0 $f1 + // @ismany "$.index[*][?(@.name=='VariantA')].inner.variant.kind.tuple[*]" $f0 $f1 VariantA(u32, String), } |