Skip to content

Commit fa60b98

Browse files
authored
Merge pull request #293 from oli-obk/push-orzyoroqpxpu
required features have a different format from normal feature names
2 parents 19f4203 + 61345fb commit fa60b98

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ pub struct Target {
596596
#[serde(rename = "required-features")]
597597
/// This target is built only if these features are enabled.
598598
/// It doesn't apply to `lib` targets.
599-
pub required_features: Vec<FeatureName>,
599+
pub required_features: Vec<String>,
600600
/// Path to the main source file of the target
601601
pub src_path: Utf8PathBuf,
602602
/// Rust edition for this target

tests/all/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ doc = false
5656
name = "reqfeat"
5757
required-features = ["feat2"]
5858

59+
[[bin]]
60+
name = "reqfeat_slash"
61+
required-features = ["featdep/i128"]
62+
5963
[workspace]
6064
exclude = ["bare-rust-version", "bdep", "benches", "devdep", "examples", "featdep", "namedep", "oldname", "path-dep", "windep"]
6165

tests/all/src/bin/reqfeat_slash.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
fn main() {}

tests/test_samples.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ fn all_the_fields() {
321321
.unwrap()
322322
};
323323
}
324-
assert_eq!(all.targets.len(), 8);
324+
assert_eq!(all.targets.len(), 9);
325325
let lib = get_file_name!("lib.rs");
326326
assert_eq!(lib.name, "all");
327327
assert_eq!(
@@ -350,7 +350,10 @@ fn all_the_fields() {
350350
assert!(!otherbin.doc);
351351

352352
let reqfeat = get_file_name!("reqfeat.rs");
353-
assert_eq!(reqfeat.required_features, features!["feat2"]);
353+
assert_eq!(reqfeat.required_features, vec!["feat2"]);
354+
355+
let reqfeat_slash = get_file_name!("reqfeat_slash.rs");
356+
assert_eq!(reqfeat_slash.required_features, vec!["featdep/i128"]);
354357

355358
let ex1 = get_file_name!("ex1.rs");
356359
assert_eq!(ex1.kind, vec!["example".into()]);

0 commit comments

Comments
 (0)