Skip to content

Commit 3ea7cf5

Browse files
committed
bootstrap: actually allow set debuginfo-level to "lines-tables-only"
1 parent 6c6b302 commit 3ea7cf5

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

Diff for: 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",
@@ -1021,8 +1024,8 @@ impl RustOptimize {
10211024

10221025
#[derive(Deserialize)]
10231026
#[serde(untagged)]
1024-
enum StringOrInt<'a> {
1025-
String(&'a str),
1027+
enum StringOrInt {
1028+
String(String),
10261029
Int(i64),
10271030
}
10281031

0 commit comments

Comments
 (0)