File: field_order.rs

package info (click to toggle)
rustc 1.85.0%2Bdfsg3-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental, sid, trixie
  • size: 893,396 kB
  • sloc: xml: 158,127; python: 35,830; javascript: 19,497; cpp: 19,002; sh: 17,245; ansic: 13,127; asm: 4,376; makefile: 1,051; perl: 29; lisp: 29; ruby: 19; sql: 11
file content (38 lines) | stat: -rw-r--r-- 1,664 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Check that the order of fields is preserved.

pub struct Foo {
    // Important: random prefixes are used here to ensure that
    // sorting fields by name would cause this test to fail.
    pub ews_0: i32,
    pub dik_1: i32,
    pub hsk_2: i32,
    pub djt_3: i32,
    pub jnr_4: i32,
    pub dfs_5: i32,
    pub bja_6: i32,
    pub lyc_7: i32,
    pub yqd_8: i32,
    pub vll_9: i32,
}

//@ set 0 = '$.index[*][?(@.name == "ews_0")].id'
//@ set 1 = '$.index[*][?(@.name == "dik_1")].id'
//@ set 2 = '$.index[*][?(@.name == "hsk_2")].id'
//@ set 3 = '$.index[*][?(@.name == "djt_3")].id'
//@ set 4 = '$.index[*][?(@.name == "jnr_4")].id'
//@ set 5 = '$.index[*][?(@.name == "dfs_5")].id'
//@ set 6 = '$.index[*][?(@.name == "bja_6")].id'
//@ set 7 = '$.index[*][?(@.name == "lyc_7")].id'
//@ set 8 = '$.index[*][?(@.name == "yqd_8")].id'
//@ set 9 = '$.index[*][?(@.name == "vll_9")].id'

//@ is '$.index[*][?(@.name == "Foo")].inner.struct.kind.plain.fields[0]' $0
//@ is '$.index[*][?(@.name == "Foo")].inner.struct.kind.plain.fields[1]' $1
//@ is '$.index[*][?(@.name == "Foo")].inner.struct.kind.plain.fields[2]' $2
//@ is '$.index[*][?(@.name == "Foo")].inner.struct.kind.plain.fields[3]' $3
//@ is '$.index[*][?(@.name == "Foo")].inner.struct.kind.plain.fields[4]' $4
//@ is '$.index[*][?(@.name == "Foo")].inner.struct.kind.plain.fields[5]' $5
//@ is '$.index[*][?(@.name == "Foo")].inner.struct.kind.plain.fields[6]' $6
//@ is '$.index[*][?(@.name == "Foo")].inner.struct.kind.plain.fields[7]' $7
//@ is '$.index[*][?(@.name == "Foo")].inner.struct.kind.plain.fields[8]' $8
//@ is '$.index[*][?(@.name == "Foo")].inner.struct.kind.plain.fields[9]' $9