Skip to content

Commit 806570f

Browse files
committed
Address review comments
- Update the documentation and doc-comments - Improve the error message for parsing Cargo.toml
1 parent 3dbb474 commit 806570f

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

src/cargo/core/profiles.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ impl DebugInfo {
762762
}
763763
}
764764

765-
/// Returns true if the debuginfo level is high enough (at least 1). Helper
765+
/// Returns true if any debuginfo will be generated. Helper
766766
/// for a common operation on the usual `Option` representation.
767767
pub(crate) fn is_turned_on(&self) -> bool {
768768
!matches!(self.to_option(), None | Some(TomlDebugInfo::None))

src/cargo/util/toml/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ impl<'de> de::Deserialize<'de> for TomlDebugInfo {
478478

479479
fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
480480
formatter
481-
.write_str("a boolean, 0-2, \"line-tables-only\", or \"line-directives-only\"")
481+
.write_str("a boolean, 0, 1, 2, \"line-tables-only\", or \"line-directives-only\"")
482482
}
483483

484484
fn visit_i64<E>(self, value: i64) -> Result<TomlDebugInfo, E>

src/doc/src/reference/profiles.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,11 @@ amount of debug information included in the compiled binary.
6767

6868
The valid options are:
6969

70-
* `0` or `false`: no debug info at all
71-
* `1`: line tables only
72-
* `2` or `true`: full debug info
70+
* `0`, `false`, or `"none"`: no debug info at all
71+
* `"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.
72+
* `"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.
73+
* `1` or `"limited"`: debug info without type or variable-level information. Generates more detailed module-level info than `line-tables-only`.
74+
* `2`, `true`, or `"full"`: full debug info
7375

7476
You may wish to also configure the [`split-debuginfo`](#split-debuginfo) option
7577
depending on your needs as well.

0 commit comments

Comments
 (0)