Skip to content

Commit b3475e6

Browse files
committed
Auto merge of #9567 - ehuss:new-rustfix, r=alexcrichton
Update rustfix. This updates rustfix to 0.6.0. There are a few changes since 0.5.0, the following are noticeable changes: * rust-lang/rustfix#185 — Fix some panics in edge cases. * rust-lang/rustfix#195 — Revert revert multiple suggestions fix The important one is rust-lang/rustfix#195 which is necessary to handle some 2021 edition migration support. I have added a test to check that it works correctly.
2 parents 46ba901 + 9362fe5 commit b3475e6

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)