diff options
| author | klensy <klensy@users.noreply.github.com> | 2024-04-02 16:33:51 +0300 |
|---|---|---|
| committer | klensy <klensy@users.noreply.github.com> | 2024-04-17 15:30:51 +0300 |
| commit | 3ea7cf538367f77b79bd81414862ade23d27aaf5 (patch) | |
| tree | 39897b4524fbe798467259fe00fff83127977b9f | |
| parent | 6c6b3027ef62e911142cfc55589baef4e9f38ec8 (diff) | |
| download | rust-3ea7cf538367f77b79bd81414862ade23d27aaf5.tar.gz rust-3ea7cf538367f77b79bd81414862ade23d27aaf5.zip | |
bootstrap: actually allow set debuginfo-level to "lines-tables-only"
| -rw-r--r-- | src/bootstrap/src/core/config/config.rs | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs index a272d8bff00..38bf4718b5a 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs @@ -70,16 +70,19 @@ impl<'de> Deserialize<'de> for DebuginfoLevel { use serde::de::Error; Ok(match Deserialize::deserialize(deserializer)? { - StringOrInt::String("none") | StringOrInt::Int(0) => DebuginfoLevel::None, - StringOrInt::String("line-tables-only") => DebuginfoLevel::LineTablesOnly, - StringOrInt::String("limited") | StringOrInt::Int(1) => DebuginfoLevel::Limited, - StringOrInt::String("full") | StringOrInt::Int(2) => DebuginfoLevel::Full, + StringOrInt::String(s) if s == "none" => DebuginfoLevel::None, + StringOrInt::Int(0) => DebuginfoLevel::None, + StringOrInt::String(s) if s == "line-tables-only" => DebuginfoLevel::LineTablesOnly, + StringOrInt::String(s) if s == "limited" => DebuginfoLevel::Limited, + StringOrInt::Int(1) => DebuginfoLevel::Limited, + StringOrInt::String(s) if s == "full" => DebuginfoLevel::Full, + StringOrInt::Int(2) => DebuginfoLevel::Full, StringOrInt::Int(n) => { let other = serde::de::Unexpected::Signed(n); return Err(D::Error::invalid_value(other, &"expected 0, 1, or 2")); } StringOrInt::String(s) => { - let other = serde::de::Unexpected::Str(s); + let other = serde::de::Unexpected::Str(&s); return Err(D::Error::invalid_value( other, &"expected none, line-tables-only, limited, or full", @@ -1021,8 +1024,8 @@ impl RustOptimize { #[derive(Deserialize)] #[serde(untagged)] -enum StringOrInt<'a> { - String(&'a str), +enum StringOrInt { + String(String), Int(i64), } |
