Enum rustfmt_nightly::ErrorKind
source · 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
sourceimpl ErrorKind
impl ErrorKind
pub(crate) fn is_comment(&self) -> bool
Trait Implementations
sourceimpl Error for ErrorKind
impl Error for ErrorKind
sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
sourceimpl From<ModuleResolutionError> for ErrorKind
impl From<ModuleResolutionError> for ErrorKind
sourcefn from(source: ModuleResolutionError) -> Self
fn from(source: ModuleResolutionError) -> Self
Auto Trait Implementations
impl !RefUnwindSafe for ErrorKind
impl Send for ErrorKind
impl Sync for ErrorKind
impl Unpin for ErrorKind
impl !UnwindSafe for ErrorKind
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
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: 88 bytes
Size for each variant:
LineOverflow
: 16 bytesTrailingWhitespace
: 0 bytesDeprecatedAttr
: 0 bytesBadAttr
: 0 bytesIoError
: 8 bytesModuleResolutionError
: 80 bytesParseError
: 0 bytesVersionMismatch
: 0 bytesLostComment
: 0 bytesInvalidGlobPattern
: 56 bytes