Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
- Update the documentation and doc-comments
- Improve the error message for parsing Cargo.toml
  • Loading branch information
jyn514 committed Apr 12, 2023
1 parent 3dbb474 commit 806570f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/cargo/core/profiles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion src/cargo/util/toml/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<E>(self, value: i64) -> Result<TomlDebugInfo, E>
Expand Down
8 changes: 5 additions & 3 deletions src/doc/src/reference/profiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 806570f

Please sign in to comment.