struct FixArgs {
file: PathBuf,
prepare_for_edition: Option<Edition>,
idioms: bool,
enabled_edition: Option<Edition>,
other: Vec<OsString>,
rustc: PathBuf,
format_args: Vec<String>,
}
Expand description
Various command-line options and settings used when cargo
is running as
a proxy for rustc
during the fix operation.
Fields§
§file: PathBuf
This is the .rs
file that is being fixed.
prepare_for_edition: Option<Edition>
If --edition
is used to migrate to the next edition, this is the
edition we are migrating towards.
idioms: bool
true
if --edition-idioms
is enabled.
enabled_edition: Option<Edition>
The current edition.
None
if on 2015.
other: Vec<OsString>
Other command-line arguments not reflected by other fields in
FixArgs
.
rustc: PathBuf
Path to the rustc
executable.
format_args: Vec<String>
Console output flags (--error-format
, --json
, etc.).
The normal fix procedure always uses --json
, so it overrides what
Cargo normally passes when applying fixes. When displaying warnings or
errors, it will use these flags.
Implementations§
source§impl FixArgs
impl FixArgs
fn get() -> CargoResult<FixArgs>
fn from_args(argv: impl IntoIterator<Item = OsString>) -> CargoResult<Self>
fn apply(&self, cmd: &mut ProcessBuilder)
sourcefn can_run_rustfix(&self, config: &Config) -> CargoResult<bool>
fn can_run_rustfix(&self, config: &Config) -> CargoResult<bool>
Validates the edition, and sends a message indicating what is being done. Returns a flag indicating whether this fix should be run.
Auto Trait Implementations§
impl RefUnwindSafe for FixArgs
impl Send for FixArgs
impl Sync for FixArgs
impl Unpin for FixArgs
impl UnwindSafe for FixArgs
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> 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> WithSubscriber for T
impl<T> WithSubscriber for T
source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,
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: 104 bytes