summaryrefslogtreecommitdiffstats
path: root/src/tools/cargo/crates/rustfix/tests/everything/replace-only-one-char.json
blob: 9a70c0880300ccd8de64be2f7c88bb9f5dcb79d0 (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
{
  "message": "unused variable: `x`",
  "code": {
    "code": "unused_variables",
    "explanation": null
  },
  "level": "warning",
  "spans": [
    {
      "file_name": "replace-only-one-char.rs",
      "byte_start": 20,
      "byte_end": 21,
      "line_start": 2,
      "line_end": 2,
      "column_start": 9,
      "column_end": 10,
      "is_primary": true,
      "text": [
        {
          "text": "    let x = 42;",
          "highlight_start": 9,
          "highlight_end": 10
        }
      ],
      "label": null,
      "suggested_replacement": null,
      "expansion": null
    }
  ],
  "children": [
    {
      "message": "#[warn(unused_variables)] on by default",
      "code": null,
      "level": "note",
      "spans": [],
      "children": [],
      "rendered": null
    },
    {
      "message": "consider using `_x` instead",
      "code": null,
      "level": "help",
      "spans": [
        {
          "file_name": "replace-only-one-char.rs",
          "byte_start": 20,
          "byte_end": 21,
          "line_start": 2,
          "line_end": 2,
          "column_start": 9,
          "column_end": 10,
          "is_primary": true,
          "text": [
            {
              "text": "    let x = 42;",
              "highlight_start": 9,
              "highlight_end": 10
            }
          ],
          "label": null,
          "suggested_replacement": "_x",
          "expansion": null
        }
      ],
      "children": [],
      "rendered": null
    }
  ],
  "rendered": "warning: unused variable: `x`\n --> replace-only-one-char.rs:2:9\n  |\n2 |     let x = 42;\n  |         ^ help: consider using `_x` instead\n  |\n  = note: #[warn(unused_variables)] on by default\n\n"
}