Skip to content

Commit 9362fe5

Browse files
committed
Update rustfix.
1 parent 46ba901 commit 9362fe5

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ memchr = "2.1.3"
4949
num_cpus = "1.0"
5050
opener = "0.4"
5151
percent-encoding = "2.0"
52-
rustfix = "0.5.0"
52+
rustfix = "0.6.0"
5353
semver = { version = "1.0.3", features = ["serde"] }
5454
serde = { version = "1.0.123", features = ["derive"] }
5555
serde_ignored = "0.1.0"

tests/testsuite/fix.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1495,3 +1495,23 @@ The following differences were detected with the current configuration:
14951495
")
14961496
.run();
14971497
}
1498+
1499+
#[cargo_test]
1500+
fn rustfix_handles_multi_spans() {
1501+
// Checks that rustfix handles a single diagnostic with multiple
1502+
// suggestion spans (non_fmt_panic in this case).
1503+
let p = project()
1504+
.file("Cargo.toml", &basic_manifest("foo", "0.1.0"))
1505+
.file(
1506+
"src/lib.rs",
1507+
r#"
1508+
pub fn foo() {
1509+
panic!(format!("hey"));
1510+
}
1511+
"#,
1512+
)
1513+
.build();
1514+
1515+
p.cargo("fix --allow-no-vcs").run();
1516+
assert!(p.read_file("src/lib.rs").contains(r#"panic!("hey");"#));
1517+
}

0 commit comments

Comments
 (0)