bootstrap: actually allow set debuginfo-level to "line-tables-only" by klensy · Pull Request #123364 · rust-lang/rust (original) (raw)

I've tried to set in config.toml rust.debuginfo-level = "line-tables-only", but ended with:

data did not match any variant of untagged enum StringOrInt for key `rust.debuginfo-level`

Also this PR allows to set line-directives-only for debuginfo in config.toml too.

  1. Fixes this. Alternative is remove that Deserialize and use default one:
    // The following is a trimmed version of what serde_derive generates. All parts not relevant
    // for toml deserialization have been removed. This reduces the binary size and improves
    // compile time of rustbuild.
    impl<'de> Deserialize<'de> for $name {
  2. Should line-directives-only be added too?
  3. I've tried to add test to rust/src/bootstrap/src/core/config/tests.rs:

#[test] fn rust_debuginfo() { assert!(matches!( parse("rust.debuginfo-level-rustc = 1").rust_debuginfo_level_rustc, DebuginfoLevel::Limited )); assert!(matches!( parse("rust.debuginfo-level-rustc = "line-tables-only"").rust_debuginfo_level_rustc, DebuginfoLevel::LineTablesOnly )); }

But test passes before that PR too; looks like config parse tests checks something wrong? I mean, that tests check something which isn't actual bootstrap behavior.