[][src]Struct cargo::core::features::CliUnstable

pub struct CliUnstable {
    pub print_im_a_teapot: bool,
    pub unstable_options: bool,
    pub no_index_update: bool,
    pub avoid_dev_deps: bool,
    pub minimal_versions: bool,
    pub package_features: bool,
    pub advanced_env: bool,
    pub config_profile: bool,
    pub dual_proc_macros: bool,
    pub mtime_on_use: bool,
    pub named_profiles: bool,
    pub binary_dep_depinfo: bool,
    pub build_std: Option<Vec<String>>,
    pub timings: Option<Vec<String>>,
    pub doctest_xcompile: bool,
    pub panic_abort_tests: bool,
}

A parsed representation of all unstable flags that Cargo accepts.

Cargo, like rustc, accepts a suite of -Z flags which are intended for gating unstable functionality to Cargo. These flags are only available on the nightly channel of Cargo.

This struct doesn't have quite the same convenience macro that the features have above, but the procedure should still be relatively stable for adding a new unstable flag:

  1. First, add a field to this CliUnstable structure. All flags are allowed to have a value as the -Z flags are either of the form -Z foo or -Z foo=bar, and it's up to you how to parse bar.

  2. Add an arm to the match statement in CliUnstable::add below to match on your new flag. The key (k) is what you're matching on and the value is in v.

  3. (optional) Add a new parsing function to parse your datatype. As of now there's an example for bool, but more can be added!

  4. In Cargo use config.cli_unstable() to get a reference to this structure and then test for your flag or your value and act accordingly.

If you have any trouble with this, please let us know!

Fields

print_im_a_teapot: boolunstable_options: boolno_index_update: boolavoid_dev_deps: boolminimal_versions: boolpackage_features: booladvanced_env: boolconfig_profile: booldual_proc_macros: boolmtime_on_use: boolnamed_profiles: boolbinary_dep_depinfo: boolbuild_std: Option<Vec<String>>timings: Option<Vec<String>>doctest_xcompile: boolpanic_abort_tests: bool

Methods

impl CliUnstable[src]

pub fn parse(&mut self, flags: &[String]) -> CargoResult<()>[src]

pub fn fail_if_stable_opt(&self, flag: &str, issue: u32) -> CargoResult<()>[src]

Generates an error if -Z unstable-options was not used. Intended to be used when a user passes a command-line flag that requires -Z unstable-options.

Trait Implementations

impl Debug for CliUnstable[src]

impl Default for CliUnstable[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,