-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #13375 - epage:panic, r=Muscraft
fix(diagnostic): Don't panic on empty spans ### What does this PR try to resolve? There is another level to this bug where we better point to where the error occurs, see toml-rs/toml#669. Fixes #13374 ### How should we test and review this PR? ### Additional information
- Loading branch information
Showing
3 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
use cargo_test_support::project; | ||
|
||
#[cargo_test] | ||
fn dont_panic_on_render() { | ||
let p = project() | ||
.file( | ||
"Cargo.toml", | ||
r#" | ||
[package] | ||
name = "foo" | ||
version = "0.1.0" | ||
edition = "2021" | ||
[[bench.foo]] | ||
"#, | ||
) | ||
.file("src/lib.rs", "") | ||
.build(); | ||
|
||
p.cargo("check") | ||
.with_status(101) | ||
.with_stderr( | ||
"\ | ||
error: invalid type: map, expected a sequence | ||
--> Cargo.toml:1:1 | ||
| | ||
| | ||
", | ||
) | ||
.run(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters