summaryrefslogtreecommitdiffstats
path: root/src/tools/cargo/crates/rustfix/tests/everything/lt-generic-comp.json
blob: 0634762e374b05682783026cd65cc2d0f459189f (plain)
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
{
  "message": "`<` is interpreted as a start of generic arguments for `u32`, not a comparison",
  "code": null,
  "level": "error",
  "spans": [
    {
      "file_name": "./tests/everything/lt-generic-comp.rs",
      "byte_start": 49,
      "byte_end": 50,
      "line_start": 4,
      "line_end": 4,
      "column_start": 19,
      "column_end": 20,
      "is_primary": false,
      "text": [
        {
          "text": "    if x as u32 < 4 {",
          "highlight_start": 19,
          "highlight_end": 20
        }
      ],
      "label": "interpreted as generic arguments",
      "suggested_replacement": null,
      "expansion": null
    },
    {
      "file_name": "./tests/everything/lt-generic-comp.rs",
      "byte_start": 47,
      "byte_end": 48,
      "line_start": 4,
      "line_end": 4,
      "column_start": 17,
      "column_end": 18,
      "is_primary": true,
      "text": [
        {
          "text": "    if x as u32 < 4 {",
          "highlight_start": 17,
          "highlight_end": 18
        }
      ],
      "label": "not interpreted as comparison",
      "suggested_replacement": null,
      "expansion": null
    }
  ],
  "children": [
    {
      "message": "try comparing the cast value",
      "code": null,
      "level": "help",
      "spans": [
        {
          "file_name": "./tests/everything/lt-generic-comp.rs",
          "byte_start": 38,
          "byte_end": 46,
          "line_start": 4,
          "line_end": 4,
          "column_start": 8,
          "column_end": 16,
          "is_primary": true,
          "text": [
            {
              "text": "    if x as u32 < 4 {",
              "highlight_start": 8,
              "highlight_end": 16
            }
          ],
          "label": null,
          "suggested_replacement": "(x as u32)",
          "expansion": null
        }
      ],
      "children": [],
      "rendered": null
    }
  ],
  "rendered": "error: `<` is interpreted as a start of generic arguments for `u32`, not a comparison\n --> ./tests/everything/lt-generic-comp.rs:4:17\n  |\n4 |     if x as u32 < 4 {\n  |        -------- ^ - interpreted as generic arguments\n  |        |        |\n  |        |        not interpreted as comparison\n  |        help: try comparing the cast value: `(x as u32)`\n\n"
}
{
  "message": "aborting due to previous error",
  "code": null,
  "level": "error",
  "spans": [],
  "children": [],
  "rendered": "error: aborting due to previous error\n\n"
}