Skip to content

Commit be33339

Browse files
author
Jon Gjengset
committed
Print features without Debug
1 parent e7ca075 commit be33339

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/cargo/core/features.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ use anyhow::{bail, Error};
101101
use serde::{Deserialize, Serialize};
102102

103103
use crate::util::errors::CargoResult;
104-
use crate::util::{indented_lines, ProcessBuilder};
104+
use crate::util::{indented_lines, iter_join, ProcessBuilder};
105105
use crate::Config;
106106

107107
pub const SEE_CHANNELS: &str =
@@ -479,9 +479,9 @@ impl Features {
479479
if let Some(allow) = &config.cli_unstable().allow_features {
480480
if !allow.contains(feature_name) {
481481
bail!(
482-
"the feature `{}` is not in the list of allowed features: {:?}",
482+
"the feature `{}` is not in the list of allowed features: [{}]",
483483
feature_name,
484-
allow,
484+
iter_join(allow, ", "),
485485
);
486486
}
487487
}
@@ -729,9 +729,9 @@ impl CliUnstable {
729729
if let Some(allowed) = &self.allow_features {
730730
if k != "allow-features" && !allowed.contains(k) {
731731
bail!(
732-
"the feature `{}` is not in the list of allowed features: {:?}",
732+
"the feature `{}` is not in the list of allowed features: [{}]",
733733
k,
734-
allowed
734+
iter_join(allowed, ", ")
735735
);
736736
}
737737
}

tests/testsuite/cargo_features.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ fn allow_features() {
157157
.with_status(101)
158158
.with_stderr(
159159
"\
160-
error: the feature `print-im-a-teapot` is not in the list of allowed features: {\"test-dummy-unstable\"}
160+
error: the feature `print-im-a-teapot` is not in the list of allowed features: [test-dummy-unstable]
161161
",
162162
)
163163
.run();
@@ -171,7 +171,7 @@ error: the feature `print-im-a-teapot` is not in the list of allowed features: {
171171
error: failed to parse manifest at `[..]`
172172
173173
Caused by:
174-
the feature `test-dummy-unstable` is not in the list of allowed features: {}
174+
the feature `test-dummy-unstable` is not in the list of allowed features: []
175175
",
176176
)
177177
.run();
@@ -279,7 +279,7 @@ fn allow_features_in_cfg() {
279279
.with_status(101)
280280
.with_stderr(
281281
"\
282-
error: the feature `unstable-options` is not in the list of allowed features: {[..]}
282+
error: the feature `unstable-options` is not in the list of allowed features: [print-im-a-teapot, test-dummy-unstable]
283283
",
284284
)
285285
.run();
@@ -291,7 +291,7 @@ error: the feature `unstable-options` is not in the list of allowed features: {[
291291
.with_status(101)
292292
.with_stderr(
293293
"\
294-
error: the feature `print-im-a-teapot` is not in the list of allowed features: {\"test-dummy-unstable\"}
294+
error: the feature `print-im-a-teapot` is not in the list of allowed features: [test-dummy-unstable]
295295
",
296296
)
297297
.run();
@@ -305,7 +305,7 @@ error: the feature `print-im-a-teapot` is not in the list of allowed features: {
305305
error: failed to parse manifest at `[..]`
306306
307307
Caused by:
308-
the feature `test-dummy-unstable` is not in the list of allowed features: {}
308+
the feature `test-dummy-unstable` is not in the list of allowed features: []
309309
",
310310
)
311311
.run();

0 commit comments

Comments
 (0)