forked from rust-lang/cargo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: factor out
Config
from core::features
To decouple manifest logic from `config.toml` behavior, a trait `UnstableFeatureContext` is created for `Features` to query any necessary information from the outer context. This is a path toward a new package for high-level manifest processing logic. The goal is to break out behavior for `Config` into several small contexts, which can be imported when needed.
- Loading branch information
Showing
3 changed files
with
45 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
use crate::core::features::AllowFeatures; | ||
use crate::core::features::UnstableFeatureContext; | ||
use crate::Config; | ||
|
||
impl UnstableFeatureContext for Config { | ||
fn nightly_features_allowed(&self) -> bool { | ||
self.nightly_features_allowed | ||
} | ||
|
||
fn allow_features(&self) -> Option<&AllowFeatures> { | ||
self.unstable_flags.allow_features.as_ref() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters