Enum rustc_parse::errors::UnescapeError
source · pub enum UnescapeError {
Show 18 variants
InvalidUnicodeEscape {
span: Span,
surrogate: bool,
},
EscapeOnlyChar {
span: Span,
char_span: Span,
escaped_sugg: String,
escaped_msg: String,
byte: bool,
},
BareCr {
span: Span,
double_quotes: bool,
},
BareCrRawString(Span),
TooShortHexEscape(Span),
InvalidCharInEscape {
span: Span,
is_hex: bool,
ch: String,
},
OutOfRangeHexEscape(Span),
LeadingUnderscoreUnicodeEscape {
span: Span,
ch: String,
},
OverlongUnicodeEscape(Span),
UnclosedUnicodeEscape(Span, Span),
NoBraceInUnicodeEscape {
span: Span,
label: Option<Span>,
sub: NoBraceUnicodeSub,
},
UnicodeEscapeInByte(Span),
EmptyUnicodeEscape(Span),
ZeroChars(Span),
LoneSlash(Span),
UnskippedWhitespace {
span: Span,
char_span: Span,
ch: String,
},
MultipleSkippedLinesWarning(Span),
MoreThanOneChar {
span: Span,
note: Option<MoreThanOneCharNote>,
suggestion: MoreThanOneCharSugg,
},
}
Variants§
InvalidUnicodeEscape
EscapeOnlyChar
BareCr
BareCrRawString(Span)
TooShortHexEscape(Span)
InvalidCharInEscape
OutOfRangeHexEscape(Span)
LeadingUnderscoreUnicodeEscape
OverlongUnicodeEscape(Span)
UnclosedUnicodeEscape(Span, Span)
NoBraceInUnicodeEscape
UnicodeEscapeInByte(Span)
EmptyUnicodeEscape(Span)
ZeroChars(Span)
LoneSlash(Span)
UnskippedWhitespace
MultipleSkippedLinesWarning(Span)
MoreThanOneChar
Trait Implementations§
source§impl<'__diagnostic_handler_sess, G> IntoDiagnostic<'__diagnostic_handler_sess, G> for UnescapeErrorwhere
G: EmissionGuarantee,
impl<'__diagnostic_handler_sess, G> IntoDiagnostic<'__diagnostic_handler_sess, G> for UnescapeErrorwhere G: EmissionGuarantee,
source§fn into_diagnostic(
self,
handler: &'__diagnostic_handler_sess Handler
) -> DiagnosticBuilder<'__diagnostic_handler_sess, G>
fn into_diagnostic( self, handler: &'__diagnostic_handler_sess Handler ) -> DiagnosticBuilder<'__diagnostic_handler_sess, G>
Write out as a diagnostic out of
Handler
.Auto Trait Implementations§
impl RefUnwindSafe for UnescapeError
impl !Send for UnescapeError
impl !Sync for UnescapeError
impl Unpin for UnescapeError
impl UnwindSafe for UnescapeError
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
Mutably borrows from an owned value. Read more
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: 144 bytes
Size for each variant:
InvalidUnicodeEscape
: 20 bytesEscapeOnlyChar
: 80 bytesBareCr
: 20 bytesBareCrRawString
: 16 bytesTooShortHexEscape
: 16 bytesInvalidCharInEscape
: 48 bytesOutOfRangeHexEscape
: 16 bytesLeadingUnderscoreUnicodeEscape
: 40 bytesOverlongUnicodeEscape
: 16 bytesUnclosedUnicodeEscape
: 24 bytesNoBraceInUnicodeEscape
: 64 bytesUnicodeEscapeInByte
: 16 bytesEmptyUnicodeEscape
: 16 bytesZeroChars
: 16 bytesLoneSlash
: 16 bytesUnskippedWhitespace
: 48 bytesMultipleSkippedLinesWarning
: 16 bytesMoreThanOneChar
: 144 bytes