diff --git a/src/cargo/core/profiles.rs b/src/cargo/core/profiles.rs index a480143a04e3..ddea1de7874a 100644 --- a/src/cargo/core/profiles.rs +++ b/src/cargo/core/profiles.rs @@ -762,7 +762,7 @@ impl DebugInfo { } } - /// Returns true if the debuginfo level is high enough (at least 1). Helper + /// Returns true if any debuginfo will be generated. Helper /// for a common operation on the usual `Option` representation. pub(crate) fn is_turned_on(&self) -> bool { !matches!(self.to_option(), None | Some(TomlDebugInfo::None)) diff --git a/src/cargo/util/toml/mod.rs b/src/cargo/util/toml/mod.rs index 18aef0263107..707137fd733b 100644 --- a/src/cargo/util/toml/mod.rs +++ b/src/cargo/util/toml/mod.rs @@ -478,7 +478,7 @@ impl<'de> de::Deserialize<'de> for TomlDebugInfo { fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { formatter - .write_str("a boolean, 0-2, \"line-tables-only\", or \"line-directives-only\"") + .write_str("a boolean, 0, 1, 2, \"line-tables-only\", or \"line-directives-only\"") } fn visit_i64(self, value: i64) -> Result diff --git a/src/doc/src/reference/profiles.md b/src/doc/src/reference/profiles.md index 56c8538f80b1..6b58d0888831 100644 --- a/src/doc/src/reference/profiles.md +++ b/src/doc/src/reference/profiles.md @@ -67,9 +67,11 @@ amount of debug information included in the compiled binary. The valid options are: -* `0` or `false`: no debug info at all -* `1`: line tables only -* `2` or `true`: full debug info +* `0`, `false`, or `"none"`: no debug info at all +* `"line-directives-only"`: line info directives only. For the nvptx* targets this enables [profiling](https://reviews.llvm.org/D46061). For other use cases, `line-tables-only` is the better, more compatible choice. +* `"line-tables-only"`: line tables only. Generates the minimal amount of debug info for backtraces with filename/line number info, but not anything else, i.e. no variable or function parameter info. +* `1` or `"limited"`: debug info without type or variable-level information. Generates more detailed module-level info than `line-tables-only`. +* `2`, `true`, or `"full"`: full debug info You may wish to also configure the [`split-debuginfo`](#split-debuginfo) option depending on your needs as well.