We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f2a4a3e commit 1c05d41Copy full SHA for 1c05d41
src/cargo/util/toml/mod.rs
@@ -121,7 +121,7 @@ fn read_manifest_from_str(
121
.rfind('\n')
122
.map(|s| s + 1)
123
.unwrap_or(0);
124
- let source_end = contents[span.end - 1..]
+ let source_end = contents[span.end.saturating_sub(1)..]
125
.find('\n')
126
.map(|s| s + span.end)
127
.unwrap_or(contents.len());
tests/testsuite/diagnostics.rs
@@ -18,6 +18,13 @@ edition = "2021"
18
19
p.cargo("check")
20
.with_status(101)
21
- .with_stderr_contains("attempt to subtract with overflow")
+ .with_stderr(
22
+ "\
23
+error: invalid type: map, expected a sequence
24
+--> Cargo.toml:1:1
25
+ |
26
27
+",
28
+ )
29
.run();
30
}
0 commit comments