Struct rustc_ap_rustc_session::config::Options[][src]

pub struct Options {
Show fields pub crate_types: Vec<CrateType>, pub optimize: OptLevel, pub debug_assertions: bool, pub debuginfo: DebugInfo, pub lint_opts: Vec<(String, Level)>, pub lint_cap: Option<Level>, pub describe_lints: bool, pub output_types: OutputTypes, pub search_paths: Vec<SearchPath>, pub libs: Vec<NativeLib>, pub maybe_sysroot: Option<PathBuf>, pub target_triple: TargetTriple, pub test: bool, pub error_format: ErrorOutputType, pub incremental: Option<PathBuf>, pub debugging_opts: DebuggingOptions, pub prints: Vec<PrintRequest>, pub borrowck_mode: BorrowckMode, pub cg: CodegenOptions, pub externs: Externs, pub extern_dep_specs: ExternDepSpecs, pub crate_name: Option<String>, pub alt_std_name: Option<String>, pub unstable_features: UnstableFeatures, pub actually_rustdoc: bool, pub trimmed_def_paths: TrimmedDefPaths, pub cli_forced_codegen_units: Option<usize>, pub cli_forced_thinlto_off: bool, pub remap_path_prefix: Vec<(PathBuf, PathBuf)>, pub real_rust_source_base_dir: Option<PathBuf>, pub edition: Edition, pub json_artifact_notifications: bool, pub json_unused_externs: bool, pub pretty: Option<PpMode>,
}
Expand description

The top-level command-line options struct.

For each option, one has to specify how it behaves with regard to the dependency tracking system of incremental compilation. This is done via the square-bracketed directive after the field type. The options are:

  • [TRACKED] A change in the given field will cause the compiler to completely clear the incremental compilation cache before proceeding.

  • [TRACKED_NO_CRATE_HASH] Same as [TRACKED], but will not affect the crate hash. This is useful for options that only affect the incremental cache.

  • [UNTRACKED] Incremental compilation is not influenced by this option.

  • [SUBSTRUCT] Second-level sub-structs containing more options.

If you add a new option to this struct or one of the sub-structs like CodegenOptions, think about how it influences incremental compilation. If in doubt, specify [TRACKED], which is always “correct” but might lead to unnecessary re-compilation.

Fields

crate_types: Vec<CrateType>

The crate config requested for the session, which may be combined with additional crate configurations during the compile process.

optimize: OptLeveldebug_assertions: bool

Include the debug_assertions flag in dependency tracking, since it can influence whether overflow checks are done or not.

debuginfo: DebugInfolint_opts: Vec<(String, Level)>lint_cap: Option<Level>describe_lints: booloutput_types: OutputTypessearch_paths: Vec<SearchPath>libs: Vec<NativeLib>maybe_sysroot: Option<PathBuf>target_triple: TargetTripletest: boolerror_format: ErrorOutputTypeincremental: Option<PathBuf>

If Some, enable incremental compilation, using the given directory to store intermediate results.

debugging_opts: DebuggingOptionsprints: Vec<PrintRequest>borrowck_mode: BorrowckMode

Determines which borrow checker(s) to run. This is the parsed, sanitized version of debugging_opts.borrowck, which is just a plain string.

cg: CodegenOptionsexterns: Externsextern_dep_specs: ExternDepSpecscrate_name: Option<String>alt_std_name: Option<String>

An optional name to use as the crate for std during std injection, written extern crate name as std. Defaults to std. Used by out-of-tree drivers.

unstable_features: UnstableFeatures

Indicates how the compiler should treat unstable features.

actually_rustdoc: bool

Indicates whether this run of the compiler is actually rustdoc. This is currently just a hack and will be removed eventually, so please try to not rely on this too much.

trimmed_def_paths: TrimmedDefPaths

Control path trimming.

cli_forced_codegen_units: Option<usize>

Specifications of codegen units / ThinLTO which are forced as a result of parsing command line options. These are not necessarily what rustc was invoked with, but massaged a bit to agree with commands like --emit llvm-ir which they’re often incompatible with if we otherwise use the defaults of rustc.

cli_forced_thinlto_off: boolremap_path_prefix: Vec<(PathBuf, PathBuf)>

Remap source path prefixes in all output (messages, object files, debug, etc.).

real_rust_source_base_dir: Option<PathBuf>

Base directory containing the src/ for the Rust standard library, and potentially rustc as well, if we can can find it. Right now it’s always $sysroot/lib/rustlib/src/rust (i.e. the rustup rust-src component).

This directory is what the virtual /rustc/$hash is translated back to, if Rust was built with path remapping to /rustc/$hash enabled (the rust.remap-debuginfo option in config.toml).

edition: Editionjson_artifact_notifications: bool

true if we’re emitting JSON blobs about each artifact produced by the compiler.

json_unused_externs: bool

true if we’re emitting a JSON blob containing the unused externs

pretty: Option<PpMode>

Implementations

impl Options[src]

pub fn build_dep_graph(&self) -> bool[src]

Returns true if there is a reason to build the dep graph.

pub fn file_path_mapping(&self) -> FilePathMapping[src]

pub fn will_create_output_file(&self) -> bool[src]

Returns true if there will be an output file generated.

pub fn share_generics(&self) -> bool[src]

impl Options[src]

pub fn dep_tracking_hash(&self, for_crate_hash: bool) -> u64[src]

Trait Implementations

impl Clone for Options[src]

fn clone(&self) -> Options[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Default for Options[src]

fn default() -> Options[src]

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

Auto Trait Implementations

impl RefUnwindSafe for Options

impl Send for Options

impl Sync for Options

impl Unpin for Options

impl UnwindSafe for Options

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T> Instrument for T[src]

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

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

fn in_current_span(self) -> Instrumented<Self>[src]

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

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

pub fn into(self) -> U[src]

Performs the conversion.

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

type Error = !

pub fn from(Result<T, <T as MaybeResult<T>>::Error>) -> T[src]

pub fn to_result(self) -> Result<T, <T as MaybeResult<T>>::Error>[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.

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

Performs the conversion.

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.

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

Performs the conversion.

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

pub fn vzip(self) -> V

impl<'a, T> Captures<'a> for T where
    T: ?Sized
[src]

impl<T> Erased for T[src]