Skip to content

Commit 648914e

Browse files
committed
bootstrap: actually allow set debuginfo-level to "lines-tables-only"
1 parent c93b17d commit 648914e

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/bootstrap/src/core/config/config.rs

+10-7
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,19 @@ impl<'de> Deserialize<'de> for DebuginfoLevel {
7070
use serde::de::Error;
7171

7272
Ok(match Deserialize::deserialize(deserializer)? {
73-
StringOrInt::String("none") | StringOrInt::Int(0) => DebuginfoLevel::None,
74-
StringOrInt::String("line-tables-only") => DebuginfoLevel::LineTablesOnly,
75-
StringOrInt::String("limited") | StringOrInt::Int(1) => DebuginfoLevel::Limited,
76-
StringOrInt::String("full") | StringOrInt::Int(2) => DebuginfoLevel::Full,
73+
StringOrInt::String(s) if s == "none" => DebuginfoLevel::None,
74+
StringOrInt::Int(0) => DebuginfoLevel::None,
75+
StringOrInt::String(s) if s == "line-tables-only" => DebuginfoLevel::LineTablesOnly,
76+
StringOrInt::String(s) if s == "limited" => DebuginfoLevel::Limited,
77+
StringOrInt::Int(1) => DebuginfoLevel::Limited,
78+
StringOrInt::String(s) if s == "full" => DebuginfoLevel::Full,
79+
StringOrInt::Int(2) => DebuginfoLevel::Full,
7780
StringOrInt::Int(n) => {
7881
let other = serde::de::Unexpected::Signed(n);
7982
return Err(D::Error::invalid_value(other, &"expected 0, 1, or 2"));
8083
}
8184
StringOrInt::String(s) => {
82-
let other = serde::de::Unexpected::Str(s);
85+
let other = serde::de::Unexpected::Str(&s);
8386
return Err(D::Error::invalid_value(
8487
other,
8588
&"expected none, line-tables-only, limited, or full",
@@ -1034,8 +1037,8 @@ impl RustOptimize {
10341037

10351038
#[derive(Deserialize)]
10361039
#[serde(untagged)]
1037-
enum StringOrInt<'a> {
1038-
String(&'a str),
1040+
enum StringOrInt {
1041+
String(String),
10391042
Int(i64),
10401043
}
10411044

0 commit comments

Comments
 (0)