pub enum UnstableFeatures {
Disallow,
Allow,
Cheat,
AllowSelectedUnstableCompilerFlagsOnly {
allowed_flags: Vec<String>,
},
}Variants§
Disallow
Disallow use of unstable features and unstable compiler flags.
Used by default by beta/stable channels.
Allow
Allow use of unstable features and unstable compiler flags.
Used by default by the nightly channel.
Cheat
Allow use of unstable features and unstable compiler flags, even if it is not the default behavior.
Can be used to make a beta/stable channel act like a nightly channel.
Errors are bypassed for bootstrapping. This is required any time during the build that feature-related lints are set to warn or above because the build turns on warnings-as-errors and uses lots of unstable features. As a result, this is always required for building Rust itself.
AllowSelectedUnstableCompilerFlagsOnly
Allow the use of selected unstable compiler flags, but disallow the use of unstable language features.
This mode is designed only for internal testing of rustc.
Specifically, we need it when we want to test how rustc behaves on the stable channel,
but at the same time we need to be able to pass it some unstable -Z compiler flags
required for the testing infrastructure itself to work.
Implementations§
Source§impl UnstableFeatures
impl UnstableFeatures
Sourcepub fn from_environment(krate: Option<&str>) -> Self
pub fn from_environment(krate: Option<&str>) -> Self
This takes into account RUSTC_BOOTSTRAP.
If krate is Some, then setting RUSTC_BOOTSTRAP=krate will enable the nightly
features. Otherwise, only RUSTC_BOOTSTRAP=1 will work.
Sourcepub(crate) fn from_environment_value(
krate: Option<&str>,
env_var_rustc_bootstrap: Result<String, VarError>,
) -> Self
pub(crate) fn from_environment_value( krate: Option<&str>, env_var_rustc_bootstrap: Result<String, VarError>, ) -> Self
Avoid unsafe std::env::set_var() by allowing tests to inject
std::env::var("RUSTC_BOOTSTRAP") with the env_var_rustc_bootstrap
arg.
Sourcepub fn allow_unstable_compiler_flag(&self, flag: &str) -> bool
pub fn allow_unstable_compiler_flag(&self, flag: &str) -> bool
Are we allowed to use the given unstable flag?
If it is a -Z<flag>, it should be passed without the -Z prefix.
pub fn is_nightly_build(&self) -> bool
Trait Implementations§
Source§impl Clone for UnstableFeatures
impl Clone for UnstableFeatures
Source§impl Debug for UnstableFeatures
impl Debug for UnstableFeatures
impl Eq for UnstableFeatures
Source§impl Hash for UnstableFeatures
impl Hash for UnstableFeatures
Source§impl PartialEq for UnstableFeatures
impl PartialEq for UnstableFeatures
impl StructuralPartialEq for UnstableFeatures
Auto Trait Implementations§
impl DynSend for UnstableFeatures
impl DynSync for UnstableFeatures
impl Freeze for UnstableFeatures
impl RefUnwindSafe for UnstableFeatures
impl Send for UnstableFeatures
impl Sync for UnstableFeatures
impl Unpin for UnstableFeatures
impl UnsafeUnpin for UnstableFeatures
impl UnwindSafe for UnstableFeatures
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
Source§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 24 bytes
Size for each variant:
Disallow: 0 bytesAllow: 0 bytesCheat: 0 bytesAllowSelectedUnstableCompilerFlagsOnly: 24 bytes