-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Introduction of namespaced features (see #1286) #5300
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
Changes from all commits
e357d17
4966f53
797d453
a9f163e
cb533ae
dc5d023
f5a4282
0b6f420
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -543,6 +543,8 @@ pub struct TomlProject { | |
autoexamples: Option<bool>, | ||
autotests: Option<bool>, | ||
autobenches: Option<bool>, | ||
#[serde(rename = "namespaced-features")] | ||
namespaced_features: Option<bool>, | ||
|
||
// package metadata | ||
description: Option<String>, | ||
|
@@ -837,12 +839,16 @@ impl TomlManifest { | |
|
||
let exclude = project.exclude.clone().unwrap_or_default(); | ||
let include = project.include.clone().unwrap_or_default(); | ||
if project.namespaced_features.is_some() { | ||
features.require(Feature::namespaced_features())?; | ||
} | ||
|
||
let summary = Summary::new( | ||
pkgid, | ||
deps, | ||
me.features.clone().unwrap_or_else(BTreeMap::new), | ||
project.links.clone(), | ||
project.namespaced_features.unwrap_or(false), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah I just remembered, can this be gated behind a feature as well? (setting this key at all) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure - not sure what kind of gate you had in mind? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh something like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @alexcrichton in that case, do we still need the separate There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For now yeah we'll want that (the Cargo feature basically unlocks the Long term we may not have both but for the near-term I think we'll want that. |
||
)?; | ||
let metadata = ManifestMetadata { | ||
description: project.description.clone(), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I keep having a tough time following this
dependency_found
logic, but is there a reason it needs to span across thematch
statement above? Could this error be moved up before thematch
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a whole bunch of comments, does that help? It spans across the for-loop (which includes the match) as a performance optimization: this way, we don't have to loop over the feature values twice. That's entirely premature (in the sense of not having done any performance measurements), so if the comments don't help enough, I could instead rewrite to check the
values
list after the loop.