]> git.proxmox.com Git - cargo.git/commitdiff
Update rustfix.
authorEric Huss <eric@huss.org>
Thu, 10 Jun 2021 01:13:56 +0000 (18:13 -0700)
committerEric Huss <eric@huss.org>
Thu, 10 Jun 2021 01:13:56 +0000 (18:13 -0700)
Cargo.toml
tests/testsuite/fix.rs

index ccbd02c313cca1b45128816e3bdcff9e68be0b00..bf3d7dc07f33774b5283fc2fc5e565c4d8af4360 100644 (file)
@@ -49,7 +49,7 @@ memchr = "2.1.3"
 num_cpus = "1.0"
 opener = "0.4"
 percent-encoding = "2.0"
-rustfix = "0.5.0"
+rustfix = "0.6.0"
 semver = { version = "1.0.3", features = ["serde"] }
 serde = { version = "1.0.123", features = ["derive"] }
 serde_ignored = "0.1.0"
index e6a733a653968319cc2fc0b43400e5c6290375f3..177d3ea11a44f494228553f0727056b6b17b3c9c 100644 (file)
@@ -1495,3 +1495,23 @@ The following differences were detected with the current configuration:
 ")
         .run();
 }
+
+#[cargo_test]
+fn rustfix_handles_multi_spans() {
+    // Checks that rustfix handles a single diagnostic with multiple
+    // suggestion spans (non_fmt_panic in this case).
+    let p = project()
+        .file("Cargo.toml", &basic_manifest("foo", "0.1.0"))
+        .file(
+            "src/lib.rs",
+            r#"
+                pub fn foo() {
+                    panic!(format!("hey"));
+                }
+            "#,
+        )
+        .build();
+
+    p.cargo("fix --allow-no-vcs").run();
+    assert!(p.read_file("src/lib.rs").contains(r#"panic!("hey");"#));
+}