Skip to content

Commit cc74523

Browse files
committed
Auto merge of #14413 - ctz:master, r=epage
Correct diagnostic for `TomlDebugInfo` This is missing the friendly aliases introduced in 3dbb474. ### What does this PR try to resolve? I wrote: ``` [profile.bench] debug = "all" ``` I got this diagnostic: ``` error: invalid value: string "all", expected a boolean, 0, 1, 2, "line-tables-only", or "line-directives-only" --> Cargo.toml:31:9 | 31 | debug = "all" | ^^^^^ | ``` I meant to write "full", as [documented here](https://doc.rust-lang.org/cargo/reference/profiles.html#debug), but that wasn't mentioned in the diagnostic. ### How should we test and review this PR? Updated the existing tests for this diagnostic.
2 parents 3293d22 + b9fe718 commit cc74523

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

crates/cargo-util-schemas/src/manifest/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1088,7 +1088,7 @@ impl<'de> de::Deserialize<'de> for TomlDebugInfo {
10881088
D: de::Deserializer<'de>,
10891089
{
10901090
use serde::de::Error as _;
1091-
let expecting = "a boolean, 0, 1, 2, \"line-tables-only\", or \"line-directives-only\"";
1091+
let expecting = "a boolean, 0, 1, 2, \"none\", \"limited\", \"full\", \"line-tables-only\", or \"line-directives-only\"";
10921092
UntaggedEnumVisitor::new()
10931093
.expecting(expecting)
10941094
.bool(|value| {

tests/testsuite/bad_config.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2686,7 +2686,7 @@ fn bad_debuginfo() {
26862686
p.cargo("check")
26872687
.with_status(101)
26882688
.with_stderr_data(str![[r#"
2689-
[ERROR] invalid value: string "a", expected a boolean, 0, 1, 2, "line-tables-only", or "line-directives-only"
2689+
[ERROR] invalid value: string "a", expected a boolean, 0, 1, 2, "none", "limited", "full", "line-tables-only", or "line-directives-only"
26902690
--> Cargo.toml:9:25
26912691
|
26922692
9 | debug = 'a'
@@ -2719,7 +2719,7 @@ fn bad_debuginfo2() {
27192719
p.cargo("check")
27202720
.with_status(101)
27212721
.with_stderr_data(str![[r#"
2722-
[ERROR] invalid type: floating point `3.6`, expected a boolean, 0, 1, 2, "line-tables-only", or "line-directives-only"
2722+
[ERROR] invalid type: floating point `3.6`, expected a boolean, 0, 1, 2, "none", "limited", "full", "line-tables-only", or "line-directives-only"
27232723
--> Cargo.toml:9:25
27242724
|
27252725
9 | debug = 3.6

0 commit comments

Comments
 (0)