Skip to content

Commit

Permalink
fix: Add named debuginfo
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Oct 29, 2024
1 parent bf6559c commit e01f8b4
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/format/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ pub struct ArtifactProfile<'a> {
/// Optimization level. Possible values are 0-3, s or z.
#[serde(borrow)]
pub opt_level: CowStr<'a>,
/// The amount of debug info. 0 for none, 1 for limited, 2 for full
pub debuginfo: Option<u32>,
/// The amount of debug info.
pub debuginfo: Option<DebugInfo<'a>>,
/// State of the `cfg(debug_assertions)` directive, enabling macros like
/// `debug_assert!`
pub debug_assertions: bool,
Expand All @@ -148,6 +148,19 @@ pub struct ArtifactProfile<'a> {
pub test: bool,
}

/// The amount of debug info. 0 for none, 1 for limited, 2 for full
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[cfg_attr(feature = "strict_unstable", serde(deny_unknown_fields))]
#[serde(untagged)]
#[non_exhaustive]
pub enum DebugInfo<'a> {
/// 0 for none, 1 for limited, 2 for full
Level(u32),
/// none, limited, full, etc
#[serde(borrow)]
Name(CowStr<'a>),
}

/// Message left by the compiler
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[cfg_attr(feature = "strict_unstable", serde(deny_unknown_fields))]
Expand Down

0 comments on commit e01f8b4

Please sign in to comment.