pub enum ErrorKind {
LineOverflow(usize, usize),
TrailingWhitespace,
DeprecatedAttr,
BadAttr,
IoError(Error),
ModuleResolutionError(ModuleResolutionError),
ParseError,
VersionMismatch,
LostComment,
InvalidGlobPattern(Error),
}
Expand description
The various errors that can occur during formatting. Note that not all of these can currently be propagated to clients.
Variants§
LineOverflow(usize, usize)
Line has exceeded character limit (found, maximum).
TrailingWhitespace
Line ends in whitespace.
DeprecatedAttr
Used deprecated skip attribute.
BadAttr
Used a rustfmt:: attribute other than skip or skip::macros.
IoError(Error)
An io error during reading or writing.
ModuleResolutionError(ModuleResolutionError)
Error during module resolution.
ParseError
Parse error occurred when parsing the input.
VersionMismatch
The user mandated a version and the current version of Rustfmt does not satisfy that requirement.
LostComment
If we had formatted the given node, then we would have lost a comment.
InvalidGlobPattern(Error)
Invalid glob pattern in ignore
configuration option.
Implementations§
Trait Implementations§
source§impl Error for ErrorKind
impl Error for ErrorKind
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
source§impl From<ModuleResolutionError> for ErrorKind
impl From<ModuleResolutionError> for ErrorKind
source§fn from(source: ModuleResolutionError) -> Self
fn from(source: ModuleResolutionError) -> Self
Auto Trait Implementations§
impl Freeze for ErrorKind
impl !RefUnwindSafe for ErrorKind
impl Send for ErrorKind
impl Sync for ErrorKind
impl Unpin for ErrorKind
impl !UnwindSafe for ErrorKind
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> 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 more§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: 72 bytes
Size for each variant:
LineOverflow
: 24 bytesTrailingWhitespace
: 0 bytesDeprecatedAttr
: 0 bytesBadAttr
: 0 bytesIoError
: 16 bytesModuleResolutionError
: 72 bytesParseError
: 0 bytesVersionMismatch
: 0 bytesLostComment
: 0 bytesInvalidGlobPattern
: 64 bytes