Skip to content

Commit 7ab71c4

Browse files
committed
tests/rustdoc-json: replace $.index[*][? with $.index[?
Done automatically with VSCode.
1 parent a0918b7 commit 7ab71c4

File tree

151 files changed

+1155
-1155
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+1155
-1155
lines changed

tests/rustdoc-json/assoc_items.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,32 @@
33
pub struct Simple;
44

55
impl Simple {
6-
//@ has "$.index[*][?(@.name=='CONSTANT')].inner.assoc_const"
6+
//@ has "$.index[?(@.name=='CONSTANT')].inner.assoc_const"
77
pub const CONSTANT: usize = 0;
88
}
99

1010
pub trait EasyToImpl {
11-
//@ has "$.index[*][?(@.docs=='ToDeclare trait')].inner.assoc_type"
12-
//@ is "$.index[*][?(@.docs=='ToDeclare trait')].inner.assoc_type.type" null
13-
//@ is "$.index[*][?(@.docs=='ToDeclare trait')].inner.assoc_type.bounds" []
11+
//@ has "$.index[?(@.docs=='ToDeclare trait')].inner.assoc_type"
12+
//@ is "$.index[?(@.docs=='ToDeclare trait')].inner.assoc_type.type" null
13+
//@ is "$.index[?(@.docs=='ToDeclare trait')].inner.assoc_type.bounds" []
1414
/// ToDeclare trait
1515
type ToDeclare;
16-
//@ has "$.index[*][?(@.docs=='AN_ATTRIBUTE trait')].inner.assoc_const"
17-
//@ is "$.index[*][?(@.docs=='AN_ATTRIBUTE trait')].inner.assoc_const.value" null
18-
//@ is "$.index[*][?(@.docs=='AN_ATTRIBUTE trait')].inner.assoc_const.type.primitive" '"usize"'
16+
//@ has "$.index[?(@.docs=='AN_ATTRIBUTE trait')].inner.assoc_const"
17+
//@ is "$.index[?(@.docs=='AN_ATTRIBUTE trait')].inner.assoc_const.value" null
18+
//@ is "$.index[?(@.docs=='AN_ATTRIBUTE trait')].inner.assoc_const.type.primitive" '"usize"'
1919
/// AN_ATTRIBUTE trait
2020
const AN_ATTRIBUTE: usize;
2121
}
2222

2323
impl EasyToImpl for Simple {
24-
//@ has "$.index[*][?(@.docs=='ToDeclare impl')].inner.assoc_type"
25-
//@ is "$.index[*][?(@.docs=='ToDeclare impl')].inner.assoc_type.type.primitive" \"usize\"
24+
//@ has "$.index[?(@.docs=='ToDeclare impl')].inner.assoc_type"
25+
//@ is "$.index[?(@.docs=='ToDeclare impl')].inner.assoc_type.type.primitive" \"usize\"
2626
/// ToDeclare impl
2727
type ToDeclare = usize;
2828

29-
//@ has "$.index[*][?(@.docs=='AN_ATTRIBUTE impl')].inner.assoc_const"
30-
//@ is "$.index[*][?(@.docs=='AN_ATTRIBUTE impl')].inner.assoc_const.type.primitive" \"usize\"
31-
//@ is "$.index[*][?(@.docs=='AN_ATTRIBUTE impl')].inner.assoc_const.value" \"12\"
29+
//@ has "$.index[?(@.docs=='AN_ATTRIBUTE impl')].inner.assoc_const"
30+
//@ is "$.index[?(@.docs=='AN_ATTRIBUTE impl')].inner.assoc_const.type.primitive" \"usize\"
31+
//@ is "$.index[?(@.docs=='AN_ATTRIBUTE impl')].inner.assoc_const.value" \"12\"
3232
/// AN_ATTRIBUTE impl
3333
const AN_ATTRIBUTE: usize = 12;
3434
}

tests/rustdoc-json/assoc_type.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Regression test for <https://github.com/rust-lang/rust/issues/98547>.
22

3-
//@ has "$.index[*][?(@.name=='Trait')]"
4-
//@ has "$.index[*][?(@.name=='AssocType')]"
5-
//@ has "$.index[*][?(@.name=='S')]"
6-
//@ has "$.index[*][?(@.name=='S2')]"
3+
//@ has "$.index[?(@.name=='Trait')]"
4+
//@ has "$.index[?(@.name=='AssocType')]"
5+
//@ has "$.index[?(@.name=='S')]"
6+
//@ has "$.index[?(@.name=='S2')]"
77

88
pub trait Trait {
99
type AssocType;
Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
1-
//@ is "$.index[*][?(@.name=='not')].attrs" []
2-
//@ is "$.index[*][?(@.name=='not')].deprecation" null
1+
//@ is "$.index[?(@.name=='not')].attrs" []
2+
//@ is "$.index[?(@.name=='not')].deprecation" null
33
pub fn not() {}
44

5-
//@ is "$.index[*][?(@.name=='raw')].attrs" []
6-
//@ is "$.index[*][?(@.name=='raw')].deprecation" '{"since": null, "note": null}'
5+
//@ is "$.index[?(@.name=='raw')].attrs" []
6+
//@ is "$.index[?(@.name=='raw')].deprecation" '{"since": null, "note": null}'
77
#[deprecated]
88
pub fn raw() {}
99

10-
//@ is "$.index[*][?(@.name=='equals_string')].attrs" []
11-
//@ is "$.index[*][?(@.name=='equals_string')].deprecation" '{"since": null, "note": "here is a reason"}'
10+
//@ is "$.index[?(@.name=='equals_string')].attrs" []
11+
//@ is "$.index[?(@.name=='equals_string')].deprecation" '{"since": null, "note": "here is a reason"}'
1212
#[deprecated = "here is a reason"]
1313
pub fn equals_string() {}
1414

15-
//@ is "$.index[*][?(@.name=='since')].attrs" []
16-
//@ is "$.index[*][?(@.name=='since')].deprecation" '{"since": "yoinks ago", "note": null}'
15+
//@ is "$.index[?(@.name=='since')].attrs" []
16+
//@ is "$.index[?(@.name=='since')].deprecation" '{"since": "yoinks ago", "note": null}'
1717
#[deprecated(since = "yoinks ago")]
1818
pub fn since() {}
1919

20-
//@ is "$.index[*][?(@.name=='note')].attrs" []
21-
//@ is "$.index[*][?(@.name=='note')].deprecation" '{"since": null, "note": "7"}'
20+
//@ is "$.index[?(@.name=='note')].attrs" []
21+
//@ is "$.index[?(@.name=='note')].deprecation" '{"since": null, "note": "7"}'
2222
#[deprecated(note = "7")]
2323
pub fn note() {}
2424

25-
//@ is "$.index[*][?(@.name=='since_and_note')].attrs" []
26-
//@ is "$.index[*][?(@.name=='since_and_note')].deprecation" '{"since": "tomorrow", "note": "sorry"}'
25+
//@ is "$.index[?(@.name=='since_and_note')].attrs" []
26+
//@ is "$.index[?(@.name=='since_and_note')].deprecation" '{"since": "tomorrow", "note": "sorry"}'
2727
#[deprecated(since = "tomorrow", note = "sorry")]
2828
pub fn since_and_note() {}
2929

30-
//@ is "$.index[*][?(@.name=='note_and_since')].attrs" []
31-
//@ is "$.index[*][?(@.name=='note_and_since')].deprecation" '{"since": "a year from tomorrow", "note": "your welcome"}'
30+
//@ is "$.index[?(@.name=='note_and_since')].attrs" []
31+
//@ is "$.index[?(@.name=='note_and_since')].deprecation" '{"since": "a year from tomorrow", "note": "your welcome"}'
3232
#[deprecated(note = "your welcome", since = "a year from tomorrow")]
3333
pub fn note_and_since() {}
3434

35-
//@ is "$.index[*][?(@.name=='neither_but_parens')].attrs" []
36-
//@ is "$.index[*][?(@.name=='neither_but_parens')].deprecation" '{"since": null, "note": null}'
35+
//@ is "$.index[?(@.name=='neither_but_parens')].attrs" []
36+
//@ is "$.index[?(@.name=='neither_but_parens')].deprecation" '{"since": null, "note": null}'
3737
#[deprecated()]
3838
pub fn neither_but_parens() {}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ edition: 2021
22
#![no_std]
33

4-
//@ is "$.index[*][?(@.name=='example')].attrs" '["#[export_name = \"altered\"]"]'
4+
//@ is "$.index[?(@.name=='example')].attrs" '["#[export_name = \"altered\"]"]'
55
#[export_name = "altered"]
66
pub extern "C" fn example() {}

tests/rustdoc-json/attrs/export_name_2024.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
// The representation of `#[unsafe(export_name = ..)]` in rustdoc in edition 2024
55
// is still `#[export_name = ..]` without the `unsafe` attribute wrapper.
66

7-
//@ is "$.index[*][?(@.name=='example')].attrs" '["#[export_name = \"altered\"]"]'
7+
//@ is "$.index[?(@.name=='example')].attrs" '["#[export_name = \"altered\"]"]'
88
#[unsafe(export_name = "altered")]
99
pub extern "C" fn example() {}

tests/rustdoc-json/attrs/must_use.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#![no_std]
22

3-
//@ is "$.index[*][?(@.name=='example')].attrs" '["#[must_use]"]'
3+
//@ is "$.index[?(@.name=='example')].attrs" '["#[must_use]"]'
44
#[must_use]
55
pub fn example() -> impl Iterator<Item = i64> {}
66

7-
//@ is "$.index[*][?(@.name=='explicit_message')].attrs" '["#[must_use = \"does nothing if you do not use it\"]"]'
7+
//@ is "$.index[?(@.name=='explicit_message')].attrs" '["#[must_use = \"does nothing if you do not use it\"]"]'
88
#[must_use = "does nothing if you do not use it"]
99
pub fn explicit_message() -> impl Iterator<Item = i64> {}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ edition: 2021
22
#![no_std]
33

4-
//@ is "$.index[*][?(@.name=='example')].attrs" '["#[no_mangle]"]'
4+
//@ is "$.index[?(@.name=='example')].attrs" '["#[no_mangle]"]'
55
#[no_mangle]
66
pub extern "C" fn example() {}

tests/rustdoc-json/attrs/no_mangle_2024.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
// The representation of `#[unsafe(no_mangle)]` in rustdoc in edition 2024
55
// is still `#[no_mangle]` without the `unsafe` attribute wrapper.
66

7-
//@ is "$.index[*][?(@.name=='example')].attrs" '["#[no_mangle]"]'
7+
//@ is "$.index[?(@.name=='example')].attrs" '["#[no_mangle]"]'
88
#[unsafe(no_mangle)]
99
pub extern "C" fn example() {}

tests/rustdoc-json/attrs/non_exhaustive.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
#![no_std]
22

3-
//@ is "$.index[*][?(@.name=='MyEnum')].attrs" '["#[non_exhaustive]"]'
3+
//@ is "$.index[?(@.name=='MyEnum')].attrs" '["#[non_exhaustive]"]'
44
#[non_exhaustive]
55
pub enum MyEnum {
66
First,
77
}
88

99
pub enum NonExhaustiveVariant {
10-
//@ is "$.index[*][?(@.name=='Variant')].attrs" '["#[non_exhaustive]"]'
10+
//@ is "$.index[?(@.name=='Variant')].attrs" '["#[non_exhaustive]"]'
1111
#[non_exhaustive]
1212
Variant(i64),
1313
}
1414

15-
//@ is "$.index[*][?(@.name=='MyStruct')].attrs" '["#[non_exhaustive]"]'
15+
//@ is "$.index[?(@.name=='MyStruct')].attrs" '["#[non_exhaustive]"]'
1616
#[non_exhaustive]
1717
pub struct MyStruct {
1818
pub x: i64,

tests/rustdoc-json/attrs/repr_align.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#![no_std]
22

3-
//@ is "$.index[*][?(@.name=='Aligned')].attrs" '["#[attr = Repr([ReprAlign(Align(4 bytes))])]\n"]'
3+
//@ is "$.index[?(@.name=='Aligned')].attrs" '["#[attr = Repr([ReprAlign(Align(4 bytes))])]\n"]'
44
#[repr(align(4))]
55
pub struct Aligned {
66
a: i8,

0 commit comments

Comments
 (0)