cargo::core::features

Struct CliUnstable

Source
pub struct CliUnstable {
Show 41 fields pub allow_features: Option<AllowFeatures>, pub print_im_a_teapot: bool, pub advanced_env: bool, pub asymmetric_token: bool, pub avoid_dev_deps: bool, pub binary_dep_depinfo: bool, pub bindeps: bool, pub build_std: Option<Vec<String>>, pub build_std_features: Option<Vec<String>>, pub cargo_lints: bool, pub checksum_freshness: bool, pub codegen_backend: bool, pub config_include: bool, pub direct_minimal_versions: bool, pub doctest_xcompile: bool, pub dual_proc_macros: bool, pub features: Option<Vec<String>>, pub gc: bool, pub git: Option<GitFeatures>, pub gitoxide: Option<GitoxideFeatures>, pub host_config: bool, pub minimal_versions: bool, pub msrv_policy: bool, pub mtime_on_use: bool, pub next_lockfile_bump: bool, pub no_index_update: bool, pub package_workspace: bool, pub panic_abort_tests: bool, pub profile_rustflags: bool, pub public_dependency: bool, pub publish_timeout: bool, pub root_dir: Option<PathBuf>, pub rustdoc_map: bool, pub rustdoc_scrape_examples: bool, pub script: bool, pub separate_nightlies: bool, pub skip_rustdoc_fingerprint: bool, pub target_applies_to_host: bool, pub trim_paths: bool, pub unstable_options: bool, pub warnings: bool,
}
Expand description

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.

Fields§

§allow_features: Option<AllowFeatures>

Allow only the listed unstable features

§print_im_a_teapot: bool§advanced_env: bool§asymmetric_token: bool

Allows authenticating with asymmetric tokens

§avoid_dev_deps: bool

Avoid installing dev-dependencies if possible

§binary_dep_depinfo: bool

Track changes to dependency artifacts

§bindeps: bool

Allow Cargo packages to depend on bin, cdylib, and staticlib crates, and use the artifacts built by those crates

§build_std: Option<Vec<String>>

Enable Cargo to compile the standard library itself as part of a crate graph compilation

§build_std_features: Option<Vec<String>>

Configure features enabled for the standard library itself when building the standard library

§cargo_lints: bool

Enable the [lints.cargo] table

§checksum_freshness: bool

Use a checksum to determine if output is fresh rather than filesystem mtime

§codegen_backend: bool

Enable the codegen-backend option in profiles in .cargo/config.toml file

§config_include: bool

Enable the include key in config files

§direct_minimal_versions: bool

Resolve minimal dependency versions instead of maximum (direct dependencies only)

§doctest_xcompile: bool

Compile and run doctests for non-host target using runner config

§dual_proc_macros: bool

Build proc-macros for both the host and the target

§features: Option<Vec<String>>§gc: bool

Track cache usage and “garbage collect” unused files

§git: Option<GitFeatures>

Enable support for shallow git fetch operations

§gitoxide: Option<GitoxideFeatures>

Use gitoxide for the given git interactions, or all of them if no argument is given

§host_config: bool

Enable the [host] section in the .cargo/config.toml file

§minimal_versions: bool

Resolve minimal dependency versions instead of maximum

§msrv_policy: bool

Enable rust-version aware policy within cargo

§mtime_on_use: bool

Configure Cargo to update the mtime of used files

§next_lockfile_bump: bool§no_index_update: bool

Do not update the registry index even if the cache is outdated

§package_workspace: bool

Handle intra-workspace dependencies when packaging

§panic_abort_tests: bool

Enable support to run tests with -Cpanic=abort

§profile_rustflags: bool

Enable the rustflags option in profiles in .cargo/config.toml file

§public_dependency: bool

Respect a dependency’s public field in Cargo.toml to control public/private dependencies

§publish_timeout: bool

Enable the publish.timeout key in .cargo/config.toml file

§root_dir: Option<PathBuf>

Set the root directory relative to which paths are printed (defaults to workspace root)

§rustdoc_map: bool

Allow passing external documentation mappings to rustdoc

§rustdoc_scrape_examples: bool

Allows Rustdoc to scrape code examples from reverse-dependencies

§script: bool

Enable support for single-file, .rs packages

§separate_nightlies: bool§skip_rustdoc_fingerprint: bool§target_applies_to_host: bool

Enable the target-applies-to-host key in the .cargo/config.toml file

§trim_paths: bool

Enable the trim-paths option in profiles

§unstable_options: bool

Allow the usage of unstable options

§warnings: bool

Allow use of the build.warnings config key

Implementations§

Source§

impl CliUnstable

Source

pub fn help() -> Vec<(&'static str, Option<&'static str>)>

Returns a list of (<option-name>, <help-text>).

Source§

impl CliUnstable

Source

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

Parses -Z flags from the command line, and returns messages that warn if any flag has alreardy been stabilized.

Source

fn add(&mut self, flag: &str, warnings: &mut Vec<String>) -> CargoResult<()>

Source

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

Generates an error if -Z unstable-options was not used for a new, unstable command-line flag.

Source

pub fn fail_if_stable_opt_custom_z( &self, flag: &str, issue: u32, z_name: &str, enabled: bool, ) -> CargoResult<()>

Source

pub fn fail_if_stable_command( &self, gctx: &GlobalContext, command: &str, issue: u32, z_name: &str, enabled: bool, ) -> CargoResult<()>

Generates an error if -Z unstable-options was not used for a new, unstable subcommand.

Trait Implementations§

Source§

impl Debug for CliUnstable

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CliUnstable

Source§

fn default() -> CliUnstable

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for CliUnstable

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

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

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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: 168 bytes