]> git.proxmox.com Git - rustc.git/blobdiff - src/doc/rustc/src/json.md
New upstream version 1.44.1+dfsg1
[rustc.git] / src / doc / rustc / src / json.md
index b737849516310478fbfad3cfa86224b9c380e13d..5dee603142dcd006067653828627192ac6023f52 100644 (file)
@@ -59,8 +59,11 @@ Diagnostics have the following format:
     "spans": [
         {
             /* The file where the span is located.
-               For spans located within a macro expansion, this will be the
-               name of the expanded macro in the format "<MACRONAME macros>".
+               Note that this path may not exist. For example, if the path
+               points to the standard library, and the rust src is not
+               available in the sysroot, then it may point to a non-existent
+               file. Beware that this may also point to the source of an
+               external crate.
             */
             "file_name": "lib.rs",
             /* The byte offset where the span starts (0-based, inclusive). */
@@ -168,7 +171,7 @@ Diagnostics have the following format:
             "rendered": null
         },
         {
-            "message": "consider prefixing with an underscore",
+            "message": "if this is intentional, prefix it with an underscore",
             "code": null,
             "level": "help",
             "spans": [
@@ -201,7 +204,7 @@ Diagnostics have the following format:
     /* Optional string of the rendered version of the diagnostic as displayed
        by rustc. Note that this may be influenced by the `--json` flag.
     */
-    "rendered": "warning: unused variable: `x`\n --> lib.rs:2:9\n  |\n2 |     let x = 123;\n  |         ^ help: consider prefixing with an underscore: `_x`\n  |\n  = note: `#[warn(unused_variables)]` on by default\n\n"
+    "rendered": "warning: unused variable: `x`\n --> lib.rs:2:9\n  |\n2 |     let x = 123;\n  |         ^ help: if this is intentional, prefix it with an underscore: `_x`\n  |\n  = note: `#[warn(unused_variables)]` on by default\n\n"
 }
 ```