Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve two error messages #9472

Merged
merged 1 commit into from
May 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/cargo/util/toml/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ impl<'de> de::Deserialize<'de> for TomlOptLevel {
Ok(TomlOptLevel(value.to_string()))
} else {
Err(E::custom(format!(
"must be an integer, `z`, or `s`, \
"must be `0`, `1`, `2`, `3`, `s` or `z`, \
but found the string: \"{}\"",
value
)))
Expand Down Expand Up @@ -553,7 +553,7 @@ impl TomlProfile {
if let Some(panic) = &self.panic {
if panic != "unwind" && panic != "abort" {
bail!(
"`panic` setting of `{}` is not a valid setting,\
"`panic` setting of `{}` is not a valid setting, \
must be `unwind` or `abort`",
panic
);
Expand Down
4 changes: 2 additions & 2 deletions tests/testsuite/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ opt-level = 'foo'
error in [..]/.cargo/config: could not load config key `profile.dev.opt-level`

Caused by:
must be an integer, `z`, or `s`, but found the string: \"foo\"",
must be `0`, `1`, `2`, `3`, `s` or `z`, but found the string: \"foo\"",
);

let config = ConfigBuilder::new()
Expand All @@ -596,7 +596,7 @@ Caused by:
error in environment variable `CARGO_PROFILE_DEV_OPT_LEVEL`: could not load config key `profile.dev.opt-level`

Caused by:
must be an integer, `z`, or `s`, but found the string: \"asdf\"",
must be `0`, `1`, `2`, `3`, `s` or `z`, but found the string: \"asdf\"",
);
}

Expand Down