Skip to content

Commit

Permalink
Update rustfix.
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuss committed Jun 10, 2021
1 parent 46ba901 commit 9362fe5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
20 changes: 20 additions & 0 deletions tests/testsuite/fix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");"#));
}

0 comments on commit 9362fe5

Please sign in to comment.