Debian Codegraph @

src/error.rs

raw symbols SCIP
1 use allocrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc crate/::stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/::{Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#, ToStringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/ToString#};
2 use corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::{
3 fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/,
4 strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/::{selfrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/, Utf8Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/error/Utf8Error#},
5 };
6
7 use serderust-analyzer cargo serde 1.0.228 crate/::{
8 derust-analyzer cargo serde_core 1.0.228 de/,
9 serrust-analyzer cargo serde_core 1.0.228 ser/::{selfrust-analyzer cargo serde_core 1.0.228 ser/, StdErrorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error#},
10 };
11 use unicode_identrust-analyzer cargo unicode-ident 1.0.0 crate/::is_xid_continuerust-analyzer cargo unicode-ident 1.0.0 is_xid_continue().;
12
13 use craterust-analyzer cargo ron 0.12.0 crate/::parserust-analyzer cargo ron 0.12.0 parse/::{is_ident_first_charrust-analyzer cargo ron 0.12.0 parse/is_ident_first_char()., is_ident_raw_charrust-analyzer cargo ron 0.12.0 parse/is_ident_raw_char().};
14
15 #[cfg(feature = "std")]
16 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/;
17
18 /// This type represents all possible errors that can occur when
19 /// serializing or deserializing RON data.
20 #[allow(clippy::module_name_repetitions)]
21 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:)]
22 pub struct SpannedErrorrust-analyzer cargo ron 0.12.0 error/SpannedError# {
23 pub coderust-analyzer cargo ron 0.12.0 error/SpannedError#code.: Errorrust-analyzer cargo ron 0.12.0 error/Error#,
24 pub spanrust-analyzer cargo ron 0.12.0 error/SpannedError#span.: Spanrust-analyzer cargo ron 0.12.0 error/Span#,
25 }
26
27 pub type Resultrust-analyzer cargo ron 0.12.0 error/Result#<T, E = Errorrust-analyzer cargo ron 0.12.0 error/Error#> = corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<T, E>;
28 pub type SpannedResultrust-analyzer cargo ron 0.12.0 error/SpannedResult#<T> = corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<T, SpannedErrorrust-analyzer cargo ron 0.12.0 error/SpannedError#>;
29
30 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:)]
31 #[non_exhaustive]
32 pub enum Errorrust-analyzer cargo ron 0.12.0 error/Error# {
33 Fmtrust-analyzer cargo ron 0.12.0 error/Error#Fmt#,
34 Iorust-analyzer cargo ron 0.12.0 error/Error#Io#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#),
35 Messagerust-analyzer cargo ron 0.12.0 error/Error#Message#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#),
36 Eofrust-analyzer cargo ron 0.12.0 error/Error#Eof#,
37 ExpectedArrayrust-analyzer cargo ron 0.12.0 error/Error#ExpectedArray#,
38 ExpectedArrayEndrust-analyzer cargo ron 0.12.0 error/Error#ExpectedArrayEnd#,
39 ExpectedAttributerust-analyzer cargo ron 0.12.0 error/Error#ExpectedAttribute#,
40 ExpectedAttributeEndrust-analyzer cargo ron 0.12.0 error/Error#ExpectedAttributeEnd#,
41 ExpectedBooleanrust-analyzer cargo ron 0.12.0 error/Error#ExpectedBoolean#,
42 ExpectedCommarust-analyzer cargo ron 0.12.0 error/Error#ExpectedComma#,
43 ExpectedCharrust-analyzer cargo ron 0.12.0 error/Error#ExpectedChar#,
44 ExpectedByteLiteralrust-analyzer cargo ron 0.12.0 error/Error#ExpectedByteLiteral#,
45 ExpectedFloatrust-analyzer cargo ron 0.12.0 error/Error#ExpectedFloat#,
46 FloatUnderscorerust-analyzer cargo ron 0.12.0 error/Error#FloatUnderscore#,
47 ExpectedIntegerrust-analyzer cargo ron 0.12.0 error/Error#ExpectedInteger#,
48 ExpectedOptionrust-analyzer cargo ron 0.12.0 error/Error#ExpectedOption#,
49 ExpectedOptionEndrust-analyzer cargo ron 0.12.0 error/Error#ExpectedOptionEnd#,
50 ExpectedMaprust-analyzer cargo ron 0.12.0 error/Error#ExpectedMap#,
51 ExpectedMapColonrust-analyzer cargo ron 0.12.0 error/Error#ExpectedMapColon#,
52 ExpectedMapEndrust-analyzer cargo ron 0.12.0 error/Error#ExpectedMapEnd#,
53 ExpectedDifferentStructNamerust-analyzer cargo ron 0.12.0 error/Error#ExpectedDifferentStructName# {
54 expectedrust-analyzer cargo ron 0.12.0 error/Error#ExpectedDifferentStructName#expected.: &'static str,
55 foundrust-analyzer cargo ron 0.12.0 error/Error#ExpectedDifferentStructName#found.: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#,
56 },
57 ExpectedStructLikerust-analyzer cargo ron 0.12.0 error/Error#ExpectedStructLike#,
58 ExpectedNamedStructLikerust-analyzer cargo ron 0.12.0 error/Error#ExpectedNamedStructLike#(&'static str),
59 ExpectedStructLikeEndrust-analyzer cargo ron 0.12.0 error/Error#ExpectedStructLikeEnd#,
60 ExpectedUnitrust-analyzer cargo ron 0.12.0 error/Error#ExpectedUnit#,
61 ExpectedStringrust-analyzer cargo ron 0.12.0 error/Error#ExpectedString#,
62 ExpectedByteStringrust-analyzer cargo ron 0.12.0 error/Error#ExpectedByteString#,
63 ExpectedStringEndrust-analyzer cargo ron 0.12.0 error/Error#ExpectedStringEnd#,
64 ExpectedIdentifierrust-analyzer cargo ron 0.12.0 error/Error#ExpectedIdentifier#,
65
66 InvalidEscaperust-analyzer cargo ron 0.12.0 error/Error#InvalidEscape#(&'static str),
67
68 IntegerOutOfBoundsrust-analyzer cargo ron 0.12.0 error/Error#IntegerOutOfBounds#,
69 InvalidIntegerDigitrust-analyzer cargo ron 0.12.0 error/Error#InvalidIntegerDigit# {
70 digitrust-analyzer cargo ron 0.12.0 error/Error#InvalidIntegerDigit#digit.: char,
71 baserust-analyzer cargo ron 0.12.0 error/Error#InvalidIntegerDigit#base.: u8,
72 },
73
74 NoSuchExtensionrust-analyzer cargo ron 0.12.0 error/Error#NoSuchExtension#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#),
75
76 UnclosedBlockCommentrust-analyzer cargo ron 0.12.0 error/Error#UnclosedBlockComment#,
77 UnclosedLineCommentrust-analyzer cargo ron 0.12.0 error/Error#UnclosedLineComment#,
78 UnderscoreAtBeginningrust-analyzer cargo ron 0.12.0 error/Error#UnderscoreAtBeginning#,
79 UnexpectedCharrust-analyzer cargo ron 0.12.0 error/Error#UnexpectedChar#(char),
80
81 Utf8Errorrust-analyzer cargo ron 0.12.0 error/Error#Utf8Error#(Utf8Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/error/Utf8Error#),
82 TrailingCharactersrust-analyzer cargo ron 0.12.0 error/Error#TrailingCharacters#,
83
84 InvalidValueForTyperust-analyzer cargo ron 0.12.0 error/Error#InvalidValueForType# {
85 expectedrust-analyzer cargo ron 0.12.0 error/Error#InvalidValueForType#expected.: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#,
86 foundrust-analyzer cargo ron 0.12.0 error/Error#InvalidValueForType#found.: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#,
87 },
88 ExpectedDifferentLengthrust-analyzer cargo ron 0.12.0 error/Error#ExpectedDifferentLength# {
89 expectedrust-analyzer cargo ron 0.12.0 error/Error#ExpectedDifferentLength#expected.: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#,
90 foundrust-analyzer cargo ron 0.12.0 error/Error#ExpectedDifferentLength#found.: usize,
91 },
92 NoSuchEnumVariantrust-analyzer cargo ron 0.12.0 error/Error#NoSuchEnumVariant# {
93 expectedrust-analyzer cargo ron 0.12.0 error/Error#NoSuchEnumVariant#expected.: &'static [&'static str],
94 foundrust-analyzer cargo ron 0.12.0 error/Error#NoSuchEnumVariant#found.: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#,
95 outerrust-analyzer cargo ron 0.12.0 error/Error#NoSuchEnumVariant#outer.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>,
96 },
97 NoSuchStructFieldrust-analyzer cargo ron 0.12.0 error/Error#NoSuchStructField# {
98 expectedrust-analyzer cargo ron 0.12.0 error/Error#NoSuchStructField#expected.: &'static [&'static str],
99 foundrust-analyzer cargo ron 0.12.0 error/Error#NoSuchStructField#found.: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#,
100 outerrust-analyzer cargo ron 0.12.0 error/Error#NoSuchStructField#outer.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>,
101 },
102 MissingStructFieldrust-analyzer cargo ron 0.12.0 error/Error#MissingStructField# {
103 fieldrust-analyzer cargo ron 0.12.0 error/Error#MissingStructField#field.: &'static str,
104 outerrust-analyzer cargo ron 0.12.0 error/Error#MissingStructField#outer.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>,
105 },
106 DuplicateStructFieldrust-analyzer cargo ron 0.12.0 error/Error#DuplicateStructField# {
107 fieldrust-analyzer cargo ron 0.12.0 error/Error#DuplicateStructField#field.: &'static str,
108 outerrust-analyzer cargo ron 0.12.0 error/Error#DuplicateStructField#outer.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>,
109 },
110 InvalidIdentifierrust-analyzer cargo ron 0.12.0 error/Error#InvalidIdentifier#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#),
111 SuggestRawIdentifierrust-analyzer cargo ron 0.12.0 error/Error#SuggestRawIdentifier#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#),
112 ExpectedRawValuerust-analyzer cargo ron 0.12.0 error/Error#ExpectedRawValue#,
113 ExceededRecursionLimitrust-analyzer cargo ron 0.12.0 error/Error#ExceededRecursionLimit#,
114 ExpectedStructNamerust-analyzer cargo ron 0.12.0 error/Error#ExpectedStructName#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#),
115 }
116
117 impl fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display# for SpannedErrorrust-analyzer cargo ron 0.12.0 error/SpannedError# {
118 fn fmtrust-analyzer cargo ron 0.12.0 error/impl#[SpannedError][Display]fmt().(&self, f: &mut fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#<'_>) -> fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Result# {
119 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "{}: {}", self.spanrust-analyzer cargo ron 0.12.0 error/SpannedError#span., self.coderust-analyzer cargo ron 0.12.0 error/SpannedError#code.)
120 }
121 }
122
123 impl fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display# for Errorrust-analyzer cargo ron 0.12.0 error/Error# {
124 #[allow(clippy::too_many_lines)]
125 fn fmtrust-analyzer cargo ron 0.12.0 error/impl#[Error][Display]fmt().(&self, f: &mut fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#<'_>) -> fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Result# {
126 match *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().self {
127 Errorrust-analyzer cargo ron 0.12.0 error/Error#::Fmtrust-analyzer cargo ron 0.12.0 error/Error#Fmt# => f.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().("Formatting RON failed"),
128 Errorrust-analyzer cargo ron 0.12.0 error/Error#::Iorust-analyzer cargo ron 0.12.0 error/Error#Io#(ref s) | Errorrust-analyzer cargo ron 0.12.0 error/Error#::Messagerust-analyzer cargo ron 0.12.0 error/Error#Message#(ref s) => f.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().(s),
129 Errorrust-analyzer cargo ron 0.12.0 error/Error#::Eofrust-analyzer cargo ron 0.12.0 error/Error#Eof# => f.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().("Unexpected end of RON"),
130 Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedArrayrust-analyzer cargo ron 0.12.0 error/Error#ExpectedArray# => f.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().("Expected opening `[`"),
131 Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedArrayEndrust-analyzer cargo ron 0.12.0 error/Error#ExpectedArrayEnd# => f.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().("Expected closing `]`"),
132 Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedAttributerust-analyzer cargo ron 0.12.0 error/Error#ExpectedAttribute# => f.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().("Expected an `#![enable(...)]` attribute"),
133 Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedAttributeEndrust-analyzer cargo ron 0.12.0 error/Error#ExpectedAttributeEnd# => {
134 f.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().("Expected closing `)]` after the enable attribute")
135 }
136 Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedBooleanrust-analyzer cargo ron 0.12.0 error/Error#ExpectedBoolean# => f.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().("Expected boolean"),
137 Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedCommarust-analyzer cargo ron 0.12.0 error/Error#ExpectedComma# => f.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().("Expected comma"),
138 Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedCharrust-analyzer cargo ron 0.12.0 error/Error#ExpectedChar# => f.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().("Expected char"),
139 Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedByteLiteralrust-analyzer cargo ron 0.12.0 error/Error#ExpectedByteLiteral# => f.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().("Expected byte literal"),
140 Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedFloatrust-analyzer cargo ron 0.12.0 error/Error#ExpectedFloat# => f.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().("Expected float"),
141 Errorrust-analyzer cargo ron 0.12.0 error/Error#::FloatUnderscorerust-analyzer cargo ron 0.12.0 error/Error#FloatUnderscore# => f.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().("Unexpected underscore in float"),
142 Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedIntegerrust-analyzer cargo ron 0.12.0 error/Error#ExpectedInteger# => f.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().("Expected integer"),
143 Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedOptionrust-analyzer cargo ron 0.12.0 error/Error#ExpectedOption# => f.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().("Expected option"),
144 Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedOptionEndrust-analyzer cargo ron 0.12.0 error/Error#ExpectedOptionEnd# | Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedStructLikeEndrust-analyzer cargo ron 0.12.0 error/Error#ExpectedStructLikeEnd# => {
145 f.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().("Expected closing `)`")
146 }
147 Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedMaprust-analyzer cargo ron 0.12.0 error/Error#ExpectedMap# => f.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().("Expected opening `{`"),
148 Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedMapColonrust-analyzer cargo ron 0.12.0 error/Error#ExpectedMapColon# => f.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().("Expected colon"),
149 Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedMapEndrust-analyzer cargo ron 0.12.0 error/Error#ExpectedMapEnd# => f.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().("Expected closing `}`"),
150 Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedDifferentStructNamerust-analyzer cargo ron 0.12.0 error/Error#ExpectedDifferentStructName# {
151 expectedrust-analyzer cargo ron 0.12.0 error/Error#ExpectedDifferentStructName#expected.,
152 ref foundrust-analyzer cargo ron 0.12.0 error/Error#ExpectedDifferentStructName#found.,
153 } => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(
154 f,
155 "Expected struct {} but found {}",
156 Identifierrust-analyzer cargo ron 0.12.0 error/Identifier#(expected),
157 Identifierrust-analyzer cargo ron 0.12.0 error/Identifier#(found)
158 ),
159 Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedStructLikerust-analyzer cargo ron 0.12.0 error/Error#ExpectedStructLike# => f.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().("Expected opening `(`"),
160 Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedNamedStructLikerust-analyzer cargo ron 0.12.0 error/Error#ExpectedNamedStructLike#(name) => {
161 if name.is_emptyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]is_empty().() {
162 f.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().("Expected only opening `(`, no name, for un-nameable struct")
163 } else {
164 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "Expected opening `(` for struct {}", Identifierrust-analyzer cargo ron 0.12.0 error/Identifier#(name))
165 }
166 }
167 Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedUnitrust-analyzer cargo ron 0.12.0 error/Error#ExpectedUnit# => f.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().("Expected unit"),
168 Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedStringrust-analyzer cargo ron 0.12.0 error/Error#ExpectedString# => f.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().("Expected string"),
169 Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedByteStringrust-analyzer cargo ron 0.12.0 error/Error#ExpectedByteString# => f.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().("Expected byte string"),
170 Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedStringEndrust-analyzer cargo ron 0.12.0 error/Error#ExpectedStringEnd# => f.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().("Expected end of string"),
171 Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedIdentifierrust-analyzer cargo ron 0.12.0 error/Error#ExpectedIdentifier# => f.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().("Expected identifier"),
172 Errorrust-analyzer cargo ron 0.12.0 error/Error#::InvalidEscaperust-analyzer cargo ron 0.12.0 error/Error#InvalidEscape#(s) => f.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().(s),
173 Errorrust-analyzer cargo ron 0.12.0 error/Error#::IntegerOutOfBoundsrust-analyzer cargo ron 0.12.0 error/Error#IntegerOutOfBounds# => f.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().("Integer is out of bounds"),
174 Errorrust-analyzer cargo ron 0.12.0 error/Error#::InvalidIntegerDigitrust-analyzer cargo ron 0.12.0 error/Error#InvalidIntegerDigit# { digitrust-analyzer cargo ron 0.12.0 error/Error#InvalidIntegerDigit#digit., baserust-analyzer cargo ron 0.12.0 error/Error#InvalidIntegerDigit#base. } => {
175 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "Invalid digit {:?} for base {} integers", digit, base)
176 }
177 Errorrust-analyzer cargo ron 0.12.0 error/Error#::NoSuchExtensionrust-analyzer cargo ron 0.12.0 error/Error#NoSuchExtension#(ref name) => {
178 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "No RON extension named {}", Identifierrust-analyzer cargo ron 0.12.0 error/Identifier#(name))
179 }
180 Errorrust-analyzer cargo ron 0.12.0 error/Error#::Utf8Errorrust-analyzer cargo ron 0.12.0 error/Error#Utf8Error#(ref e) => fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display#::fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/error/impl#[Utf8Error][Display]fmt().(e, f),
181 Errorrust-analyzer cargo ron 0.12.0 error/Error#::UnclosedBlockCommentrust-analyzer cargo ron 0.12.0 error/Error#UnclosedBlockComment# => f.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().("Unclosed block comment"),
182 Errorrust-analyzer cargo ron 0.12.0 error/Error#::UnclosedLineCommentrust-analyzer cargo ron 0.12.0 error/Error#UnclosedLineComment# => f.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().(
183 "`ron::value::RawValue` cannot end in unclosed line comment, \
184 try using a block comment or adding a newline",
185 ),
186 Errorrust-analyzer cargo ron 0.12.0 error/Error#::UnderscoreAtBeginningrust-analyzer cargo ron 0.12.0 error/Error#UnderscoreAtBeginning# => {
187 f.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().("Unexpected leading underscore in a number")
188 }
189 Errorrust-analyzer cargo ron 0.12.0 error/Error#::UnexpectedCharrust-analyzer cargo ron 0.12.0 error/Error#UnexpectedChar#(c) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "Unexpected char {:?}", c),
190 Errorrust-analyzer cargo ron 0.12.0 error/Error#::TrailingCharactersrust-analyzer cargo ron 0.12.0 error/Error#TrailingCharacters# => f.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().("Non-whitespace trailing characters"),
191 Errorrust-analyzer cargo ron 0.12.0 error/Error#::InvalidValueForTyperust-analyzer cargo ron 0.12.0 error/Error#InvalidValueForType# {
192 ref expectedrust-analyzer cargo ron 0.12.0 error/Error#InvalidValueForType#expected.,
193 ref foundrust-analyzer cargo ron 0.12.0 error/Error#InvalidValueForType#found.,
194 } => {
195 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "Expected {} but found {} instead", expected, found)
196 }
197 Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedDifferentLengthrust-analyzer cargo ron 0.12.0 error/Error#ExpectedDifferentLength# {
198 ref expectedrust-analyzer cargo ron 0.12.0 error/Error#ExpectedDifferentLength#expected.,
199 foundrust-analyzer cargo ron 0.12.0 error/Error#ExpectedDifferentLength#found.,
200 } => {
201 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "Expected {} but found ", expected)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
202
203 match found {
204 0 => f.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().("zero elements")?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().,
205 1 => f.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().("one element")?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().,
206 n => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "{} elements", n)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().,
207 }
208
209 f.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().(" instead")
210 }
211 Errorrust-analyzer cargo ron 0.12.0 error/Error#::NoSuchEnumVariantrust-analyzer cargo ron 0.12.0 error/Error#NoSuchEnumVariant# {
212 expectedrust-analyzer cargo ron 0.12.0 error/Error#NoSuchEnumVariant#expected.,
213 ref foundrust-analyzer cargo ron 0.12.0 error/Error#NoSuchEnumVariant#found.,
214 ref outerrust-analyzer cargo ron 0.12.0 error/Error#NoSuchEnumVariant#outer.,
215 } => {
216 f.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().("Unexpected ")?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
217
218 if outer.is_nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_none().() {
219 f.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().("enum ")?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
220 }
221
222 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "variant named {}", Identifierrust-analyzer cargo ron 0.12.0 error/Identifier#(found))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
223
224 if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(outer) = outer {
225 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, " in enum {}", Identifierrust-analyzer cargo ron 0.12.0 error/Identifier#(outer))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
226 }
227
228 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(
229 f,
230 ", {}",
231 OneOfrust-analyzer cargo ron 0.12.0 error/OneOf# {
232 altsrust-analyzer cargo ron 0.12.0 error/OneOf#alts.: expected,
233 nonerust-analyzer cargo ron 0.12.0 error/OneOf#none.: "variants"
234 }
235 )
236 }
237 Errorrust-analyzer cargo ron 0.12.0 error/Error#::NoSuchStructFieldrust-analyzer cargo ron 0.12.0 error/Error#NoSuchStructField# {
238 expectedrust-analyzer cargo ron 0.12.0 error/Error#NoSuchStructField#expected.,
239 ref foundrust-analyzer cargo ron 0.12.0 error/Error#NoSuchStructField#found.,
240 ref outerrust-analyzer cargo ron 0.12.0 error/Error#NoSuchStructField#outer.,
241 } => {
242 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "Unexpected field named {}", Identifierrust-analyzer cargo ron 0.12.0 error/Identifier#(found))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
243
244 if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(outer) = outer {
245 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, " in {}", Identifierrust-analyzer cargo ron 0.12.0 error/Identifier#(outer))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
246 }
247
248 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(
249 f,
250 ", {}",
251 OneOfrust-analyzer cargo ron 0.12.0 error/OneOf# {
252 altsrust-analyzer cargo ron 0.12.0 error/OneOf#alts.: expected,
253 nonerust-analyzer cargo ron 0.12.0 error/OneOf#none.: "fields"
254 }
255 )
256 }
257 Errorrust-analyzer cargo ron 0.12.0 error/Error#::MissingStructFieldrust-analyzer cargo ron 0.12.0 error/Error#MissingStructField# { fieldrust-analyzer cargo ron 0.12.0 error/Error#MissingStructField#field., ref outerrust-analyzer cargo ron 0.12.0 error/Error#MissingStructField#outer. } => {
258 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "Unexpected missing field named {}", Identifierrust-analyzer cargo ron 0.12.0 error/Identifier#(field))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
259
260 match outer {
261 Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(outer) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, " in {}", Identifierrust-analyzer cargo ron 0.12.0 error/Identifier#(outer)),
262 Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()),
263 }
264 }
265 Errorrust-analyzer cargo ron 0.12.0 error/Error#::DuplicateStructFieldrust-analyzer cargo ron 0.12.0 error/Error#DuplicateStructField# { fieldrust-analyzer cargo ron 0.12.0 error/Error#DuplicateStructField#field., ref outerrust-analyzer cargo ron 0.12.0 error/Error#DuplicateStructField#outer. } => {
266 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "Unexpected duplicate field named {}", Identifierrust-analyzer cargo ron 0.12.0 error/Identifier#(field))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
267
268 match outer {
269 Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(outer) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, " in {}", Identifierrust-analyzer cargo ron 0.12.0 error/Identifier#(outer)),
270 Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()),
271 }
272 }
273 Errorrust-analyzer cargo ron 0.12.0 error/Error#::InvalidIdentifierrust-analyzer cargo ron 0.12.0 error/Error#InvalidIdentifier#(ref invalid) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "Invalid identifier {:?}", invalid),
274 Errorrust-analyzer cargo ron 0.12.0 error/Error#::SuggestRawIdentifierrust-analyzer cargo ron 0.12.0 error/Error#SuggestRawIdentifier#(ref identifier) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(
275 f,
276 "Found invalid std identifier {:?}, try the raw identifier `r#{}` instead",
277 identifier, identifier
278 ),
279 Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedRawValuerust-analyzer cargo ron 0.12.0 error/Error#ExpectedRawValue# => f.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().("Expected a `ron::value::RawValue`"),
280 Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExceededRecursionLimitrust-analyzer cargo ron 0.12.0 error/Error#ExceededRecursionLimit# => f.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().(
281 "Exceeded recursion limit, try increasing `ron::Options::recursion_limit` \
282 and using `serde_stacker` to protect against a stack overflow",
283 ),
284 Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedStructNamerust-analyzer cargo ron 0.12.0 error/Error#ExpectedStructName#(ref name) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(
285 f,
286 "Expected the explicit struct name {}, but none was found",
287 Identifierrust-analyzer cargo ron 0.12.0 error/Identifier#(name)
288 ),
289 }
290 }
291 }
292
293 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:, PartialOrdrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialOrd:, Ordrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ord:)]
294 pub struct Positionrust-analyzer cargo ron 0.12.0 error/Position# {
295 pub linerust-analyzer cargo ron 0.12.0 error/Position#line.: usize,
296 pub colrust-analyzer cargo ron 0.12.0 error/Position#col.: usize,
297 }
298
299 impl Positionrust-analyzer cargo ron 0.12.0 error/Position# {
300 pub(craterust-analyzer cargo ron 0.12.0 crate/) fn from_src_endrust-analyzer cargo ron 0.12.0 error/impl#[Position]from_src_end().(src: &str) -> Positionrust-analyzer cargo ron 0.12.0 error/Position# {
301 let line = 1 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().src.charsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]chars().().filterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#filter().(|&c| c rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]eq().'\n').countrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/adapters/filter/impl#[`Filter<I, P>`][Iterator]count().();
302 let col = 1 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().src.charsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]chars().().revrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#rev().().take_whilerust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#take_while().(|&c| c rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[char][`PartialEq<Self>`]ne().'\n').countrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#count().();
303
304 Selfrust-analyzer cargo ron 0.12.0 error/impl#[Position] { linerust-analyzer cargo ron 0.12.0 error/Position#line., colrust-analyzer cargo ron 0.12.0 error/Position#col. }
305 }
306 }
307
308 impl fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display# for Positionrust-analyzer cargo ron 0.12.0 error/Position# {
309 fn fmtrust-analyzer cargo ron 0.12.0 error/impl#[Position][Display]fmt().(&self, f: &mut fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#<'_>) -> fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Result# {
310 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "{}:{}", self.linerust-analyzer cargo ron 0.12.0 error/Position#line., self.colrust-analyzer cargo ron 0.12.0 error/Position#col.)
311 }
312 }
313
314 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:)]
315 /// Spans select a range of text between two positions.
316 /// Spans are used in [`SpannedError`] to indicate the start and end positions
317 /// of the parser cursor before and after it encountered an error in parsing.
318 pub struct Spanrust-analyzer cargo ron 0.12.0 error/Span# {
319 pub startrust-analyzer cargo ron 0.12.0 error/Span#start.: Positionrust-analyzer cargo ron 0.12.0 error/Position#,
320 pub endrust-analyzer cargo ron 0.12.0 error/Span#end.: Positionrust-analyzer cargo ron 0.12.0 error/Position#,
321 }
322
323 impl fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display# for Spanrust-analyzer cargo ron 0.12.0 error/Span# {
324 fn fmtrust-analyzer cargo ron 0.12.0 error/impl#[Span][Display]fmt().(&self, f: &mut fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#<'_>) -> fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Result# {
325 if self.startrust-analyzer cargo ron 0.12.0 error/Span#start. rust-analyzer cargo ron 0.12.0 error/impl#[Position][`PartialEq<Self>`]eq().==rust-analyzer cargo ron 0.12.0 error/impl#[Position][`PartialEq<Self>`]eq(). rust-analyzer cargo ron 0.12.0 error/impl#[Position][`PartialEq<Self>`]eq().self.endrust-analyzer cargo ron 0.12.0 error/Span#end. {
326 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "{}", self.startrust-analyzer cargo ron 0.12.0 error/Span#start.)
327 } else {
328 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "{}-{}", self.startrust-analyzer cargo ron 0.12.0 error/Span#start., self.endrust-analyzer cargo ron 0.12.0 error/Span#end.)
329 }
330 }
331 }
332
333 impl serrust-analyzer cargo serde_core 1.0.228 ser/::Errorrust-analyzer cargo serde_core 1.0.228 ser/Error# for Errorrust-analyzer cargo ron 0.12.0 error/Error# {
334 #[cold]
335 fn customrust-analyzer cargo ron 0.12.0 error/impl#[Error][Error]custom().<T: fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display#>(msg: T) -> Selfrust-analyzer cargo ron 0.12.0 error/impl#[Error][Error] {
336 Errorrust-analyzer cargo ron 0.12.0 error/Error#::Messagerust-analyzer cargo ron 0.12.0 error/Error#Message#(msg.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().())
337 }
338 }
339
340 impl derust-analyzer cargo serde_core 1.0.228 de/::Errorrust-analyzer cargo serde_core 1.0.228 de/Error# for Errorrust-analyzer cargo ron 0.12.0 error/Error# {
341 #[cold]
342 fn customrust-analyzer cargo ron 0.12.0 error/impl#[Error][Error]custom().<T: fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display#>(msg: T) -> Selfrust-analyzer cargo ron 0.12.0 error/impl#[Error][Error] {
343 Errorrust-analyzer cargo ron 0.12.0 error/Error#::Messagerust-analyzer cargo ron 0.12.0 error/Error#Message#(msg.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().())
344 }
345
346 #[cold]
347 fn invalid_typerust-analyzer cargo ron 0.12.0 error/impl#[Error][Error]invalid_type().(unexp: derust-analyzer cargo serde_core 1.0.228 de/::Unexpectedrust-analyzer cargo serde_core 1.0.228 de/Unexpected#, exp: &dyn derust-analyzer cargo serde_core 1.0.228 de/::Expectedrust-analyzer cargo serde_core 1.0.228 de/Expected#) -> Selfrust-analyzer cargo ron 0.12.0 error/impl#[Error][Error] {
348 // Invalid type and invalid value are merged given their similarity in ron
349 Selfrust-analyzer cargo ron 0.12.0 error/impl#[Error][Error]::invalid_valuerust-analyzer cargo ron 0.12.0 error/impl#[Error][Error]invalid_value().(unexp, exp)
350 }
351
352 #[cold]
353 fn invalid_valuerust-analyzer cargo ron 0.12.0 error/impl#[Error][Error]invalid_value().(unexp: derust-analyzer cargo serde_core 1.0.228 de/::Unexpectedrust-analyzer cargo serde_core 1.0.228 de/Unexpected#, exp: &dyn derust-analyzer cargo serde_core 1.0.228 de/::Expectedrust-analyzer cargo serde_core 1.0.228 de/Expected#) -> Selfrust-analyzer cargo ron 0.12.0 error/impl#[Error][Error] {
354 struct UnexpectedSerdeTypeValuerust-analyzer cargo ron 0.12.0 error/UnexpectedSerdeTypeValue#<'a>(derust-analyzer cargo serde_core 1.0.228 de/::Unexpectedrust-analyzer cargo serde_core 1.0.228 de/Unexpected#<'a>);
355
356 impl<'a> fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display# for UnexpectedSerdeTypeValuerust-analyzer cargo ron 0.12.0 error/UnexpectedSerdeTypeValue#<'a> {
357 fn fmtrust-analyzer cargo ron 0.12.0 error/impl#[`UnexpectedSerdeTypeValue<'a>`][Display]fmt().(&self, f: &mut fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#<'_>) -> fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Result# {
358 match self.0rust-analyzer cargo ron 0.12.0 error/UnexpectedSerdeTypeValue#0. {
359 derust-analyzer cargo serde_core 1.0.228 de/::Unexpectedrust-analyzer cargo serde_core 1.0.228 de/Unexpected#::Boolrust-analyzer cargo serde_core 1.0.228 de/Unexpected#Bool#(b) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "the boolean `{}`", b),
360 derust-analyzer cargo serde_core 1.0.228 de/::Unexpectedrust-analyzer cargo serde_core 1.0.228 de/Unexpected#::Unsignedrust-analyzer cargo serde_core 1.0.228 de/Unexpected#Unsigned#(i) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "the unsigned integer `{}`", i),
361 derust-analyzer cargo serde_core 1.0.228 de/::Unexpectedrust-analyzer cargo serde_core 1.0.228 de/Unexpected#::Signedrust-analyzer cargo serde_core 1.0.228 de/Unexpected#Signed#(i) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "the signed integer `{}`", i),
362 derust-analyzer cargo serde_core 1.0.228 de/::Unexpectedrust-analyzer cargo serde_core 1.0.228 de/Unexpected#::Floatrust-analyzer cargo serde_core 1.0.228 de/Unexpected#Float#(n) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "the floating point number `{}`", n),
363 derust-analyzer cargo serde_core 1.0.228 de/::Unexpectedrust-analyzer cargo serde_core 1.0.228 de/Unexpected#::Charrust-analyzer cargo serde_core 1.0.228 de/Unexpected#Char#(c) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "the UTF-8 character `{}`", c),
364 derust-analyzer cargo serde_core 1.0.228 de/::Unexpectedrust-analyzer cargo serde_core 1.0.228 de/Unexpected#::Strrust-analyzer cargo serde_core 1.0.228 de/Unexpected#Str#(s) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "the string {:?}", s),
365 derust-analyzer cargo serde_core 1.0.228 de/::Unexpectedrust-analyzer cargo serde_core 1.0.228 de/Unexpected#::Bytesrust-analyzer cargo serde_core 1.0.228 de/Unexpected#Bytes#(b) => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "the byte string b\"{}\"", {
366 b.iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().()
367 .flat_maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#flat_map().(|c| corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::asciirust-analyzer cargo core https://github.com/rust-lang/rust/library/core ascii/::escape_defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ascii/escape_default().(*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().c))
368 .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(char::fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core char/convert/impl#[char][`From<u8>`]from().)
369 .collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().::<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>()
370 }),
371 derust-analyzer cargo serde_core 1.0.228 de/::Unexpectedrust-analyzer cargo serde_core 1.0.228 de/Unexpected#::Unitrust-analyzer cargo serde_core 1.0.228 de/Unexpected#Unit# => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "a unit value"),
372 derust-analyzer cargo serde_core 1.0.228 de/::Unexpectedrust-analyzer cargo serde_core 1.0.228 de/Unexpected#::Optionrust-analyzer cargo serde_core 1.0.228 de/Unexpected#Option# => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "an optional value"),
373 derust-analyzer cargo serde_core 1.0.228 de/::Unexpectedrust-analyzer cargo serde_core 1.0.228 de/Unexpected#::NewtypeStructrust-analyzer cargo serde_core 1.0.228 de/Unexpected#NewtypeStruct# => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "a newtype struct"),
374 derust-analyzer cargo serde_core 1.0.228 de/::Unexpectedrust-analyzer cargo serde_core 1.0.228 de/Unexpected#::Seqrust-analyzer cargo serde_core 1.0.228 de/Unexpected#Seq# => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "a sequence"),
375 derust-analyzer cargo serde_core 1.0.228 de/::Unexpectedrust-analyzer cargo serde_core 1.0.228 de/Unexpected#::Maprust-analyzer cargo serde_core 1.0.228 de/Unexpected#Map# => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "a map"),
376 derust-analyzer cargo serde_core 1.0.228 de/::Unexpectedrust-analyzer cargo serde_core 1.0.228 de/Unexpected#::Enumrust-analyzer cargo serde_core 1.0.228 de/Unexpected#Enum# => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "an enum"),
377 derust-analyzer cargo serde_core 1.0.228 de/::Unexpectedrust-analyzer cargo serde_core 1.0.228 de/Unexpected#::UnitVariantrust-analyzer cargo serde_core 1.0.228 de/Unexpected#UnitVariant# => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "a unit variant"),
378 derust-analyzer cargo serde_core 1.0.228 de/::Unexpectedrust-analyzer cargo serde_core 1.0.228 de/Unexpected#::NewtypeVariantrust-analyzer cargo serde_core 1.0.228 de/Unexpected#NewtypeVariant# => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "a newtype variant"),
379 derust-analyzer cargo serde_core 1.0.228 de/::Unexpectedrust-analyzer cargo serde_core 1.0.228 de/Unexpected#::TupleVariantrust-analyzer cargo serde_core 1.0.228 de/Unexpected#TupleVariant# => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "a tuple variant"),
380 derust-analyzer cargo serde_core 1.0.228 de/::Unexpectedrust-analyzer cargo serde_core 1.0.228 de/Unexpected#::StructVariantrust-analyzer cargo serde_core 1.0.228 de/Unexpected#StructVariant# => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "a struct variant"),
381 derust-analyzer cargo serde_core 1.0.228 de/::Unexpectedrust-analyzer cargo serde_core 1.0.228 de/Unexpected#::Otherrust-analyzer cargo serde_core 1.0.228 de/Unexpected#Other#(other) => f.write_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]write_str().(other),
382 }
383 }
384 }
385
386 Errorrust-analyzer cargo ron 0.12.0 error/Error#::InvalidValueForTyperust-analyzer cargo ron 0.12.0 error/Error#InvalidValueForType# {
387 expectedrust-analyzer cargo ron 0.12.0 error/Error#InvalidValueForType#expected.: exp.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(),
388 foundrust-analyzer cargo ron 0.12.0 error/Error#InvalidValueForType#found.: UnexpectedSerdeTypeValuerust-analyzer cargo ron 0.12.0 error/UnexpectedSerdeTypeValue#(unexp).to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(),
389 }
390 }
391
392 #[cold]
393 fn invalid_lengthrust-analyzer cargo ron 0.12.0 error/impl#[Error][Error]invalid_length().(len: usize, exp: &dyn derust-analyzer cargo serde_core 1.0.228 de/::Expectedrust-analyzer cargo serde_core 1.0.228 de/Expected#) -> Selfrust-analyzer cargo ron 0.12.0 error/impl#[Error][Error] {
394 Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedDifferentLengthrust-analyzer cargo ron 0.12.0 error/Error#ExpectedDifferentLength# {
395 expectedrust-analyzer cargo ron 0.12.0 error/Error#ExpectedDifferentLength#expected.: exp.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(),
396 foundrust-analyzer cargo ron 0.12.0 error/Error#ExpectedDifferentLength#found.: len,
397 }
398 }
399
400 #[cold]
401 fn unknown_variantrust-analyzer cargo ron 0.12.0 error/impl#[Error][Error]unknown_variant().(variant: &str, expected: &'static [&'static str]) -> Selfrust-analyzer cargo ron 0.12.0 error/impl#[Error][Error] {
402 Errorrust-analyzer cargo ron 0.12.0 error/Error#::NoSuchEnumVariantrust-analyzer cargo ron 0.12.0 error/Error#NoSuchEnumVariant# {
403 expectedrust-analyzer cargo ron 0.12.0 error/Error#NoSuchEnumVariant#expected.,
404 foundrust-analyzer cargo ron 0.12.0 error/Error#NoSuchEnumVariant#found.: variant.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(),
405 outerrust-analyzer cargo ron 0.12.0 error/Error#NoSuchEnumVariant#outer.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#,
406 }
407 }
408
409 #[cold]
410 fn unknown_fieldrust-analyzer cargo ron 0.12.0 error/impl#[Error][Error]unknown_field().(field: &str, expected: &'static [&'static str]) -> Selfrust-analyzer cargo ron 0.12.0 error/impl#[Error][Error] {
411 Errorrust-analyzer cargo ron 0.12.0 error/Error#::NoSuchStructFieldrust-analyzer cargo ron 0.12.0 error/Error#NoSuchStructField# {
412 expectedrust-analyzer cargo ron 0.12.0 error/Error#NoSuchStructField#expected.,
413 foundrust-analyzer cargo ron 0.12.0 error/Error#NoSuchStructField#found.: field.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(),
414 outerrust-analyzer cargo ron 0.12.0 error/Error#NoSuchStructField#outer.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#,
415 }
416 }
417
418 #[cold]
419 fn missing_fieldrust-analyzer cargo ron 0.12.0 error/impl#[Error][Error]missing_field().(field: &'static str) -> Selfrust-analyzer cargo ron 0.12.0 error/impl#[Error][Error] {
420 Errorrust-analyzer cargo ron 0.12.0 error/Error#::MissingStructFieldrust-analyzer cargo ron 0.12.0 error/Error#MissingStructField# { fieldrust-analyzer cargo ron 0.12.0 error/Error#MissingStructField#field., outerrust-analyzer cargo ron 0.12.0 error/Error#MissingStructField#outer.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# }
421 }
422
423 #[cold]
424 fn duplicate_fieldrust-analyzer cargo ron 0.12.0 error/impl#[Error][Error]duplicate_field().(field: &'static str) -> Selfrust-analyzer cargo ron 0.12.0 error/impl#[Error][Error] {
425 Errorrust-analyzer cargo ron 0.12.0 error/Error#::DuplicateStructFieldrust-analyzer cargo ron 0.12.0 error/Error#DuplicateStructField# { fieldrust-analyzer cargo ron 0.12.0 error/Error#DuplicateStructField#field., outerrust-analyzer cargo ron 0.12.0 error/Error#DuplicateStructField#outer.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# }
426 }
427 }
428
429 impl StdErrorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error# for SpannedErrorrust-analyzer cargo ron 0.12.0 error/SpannedError# {}
430
431 impl StdErrorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error# for Errorrust-analyzer cargo ron 0.12.0 error/Error# {}
432
433 impl Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<Utf8Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/error/Utf8Error#> for Errorrust-analyzer cargo ron 0.12.0 error/Error# {
434 fn fromrust-analyzer cargo ron 0.12.0 error/impl#[Error][`From<Utf8Error>`]from().(e: Utf8Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/error/Utf8Error#) -> Selfrust-analyzer cargo ron 0.12.0 error/impl#[Error][`From<Utf8Error>`] {
435 Errorrust-analyzer cargo ron 0.12.0 error/Error#::Utf8Errorrust-analyzer cargo ron 0.12.0 error/Error#Utf8Error#(e)
436 }
437 }
438
439 impl Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Error#> for Errorrust-analyzer cargo ron 0.12.0 error/Error# {
440 fn fromrust-analyzer cargo ron 0.12.0 error/impl#[Error][`From<fmt::Error>`]from().(_: fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Error#) -> Selfrust-analyzer cargo ron 0.12.0 error/impl#[Error][`From<fmt::Error>`] {
441 Errorrust-analyzer cargo ron 0.12.0 error/Error#::Fmtrust-analyzer cargo ron 0.12.0 error/Error#Fmt#
442 }
443 }
444
445 #[cfg(feature = "std")]
446 impl Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Error#> for Errorrust-analyzer cargo ron 0.12.0 error/Error# {
447 fn fromrust-analyzer cargo ron 0.12.0 error/impl#[Error][`From<io::Error>`]from().(e: iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Error#) -> Selfrust-analyzer cargo ron 0.12.0 error/impl#[Error][`From<io::Error>`] {
448 Errorrust-analyzer cargo ron 0.12.0 error/Error#::Iorust-analyzer cargo ron 0.12.0 error/Error#Io#(e.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().())
449 }
450 }
451
452 impl Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<SpannedErrorrust-analyzer cargo ron 0.12.0 error/SpannedError#> for Errorrust-analyzer cargo ron 0.12.0 error/Error# {
453 fn fromrust-analyzer cargo ron 0.12.0 error/impl#[Error][`From<SpannedError>`]from().(e: SpannedErrorrust-analyzer cargo ron 0.12.0 error/SpannedError#) -> Selfrust-analyzer cargo ron 0.12.0 error/impl#[Error][`From<SpannedError>`] {
454 e.coderust-analyzer cargo ron 0.12.0 error/SpannedError#code.
455 }
456 }
457
458 struct OneOfrust-analyzer cargo ron 0.12.0 error/OneOf# {
459 altsrust-analyzer cargo ron 0.12.0 error/OneOf#alts.: &'static [&'static str],
460 nonerust-analyzer cargo ron 0.12.0 error/OneOf#none.: &'static str,
461 }
462
463 impl fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display# for OneOfrust-analyzer cargo ron 0.12.0 error/OneOf# {
464 fn fmtrust-analyzer cargo ron 0.12.0 error/impl#[OneOf][Display]fmt().(&self, f: &mut fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#<'_>) -> fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Result# {
465 match self.altsrust-analyzer cargo ron 0.12.0 error/OneOf#alts. {
466 [] => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "there are no {}", self.nonerust-analyzer cargo ron 0.12.0 error/OneOf#none.),
467 [a1] => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "expected {} instead", Identifierrust-analyzer cargo ron 0.12.0 error/Identifier#(a1)),
468 [a1, a2] => writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(
469 f,
470 "expected either {} or {} instead",
471 Identifierrust-analyzer cargo ron 0.12.0 error/Identifier#(a1),
472 Identifierrust-analyzer cargo ron 0.12.0 error/Identifier#(a2)
473 ),
474 [a1, ref alts @ .., an] => {
475 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "expected one of {}", Identifierrust-analyzer cargo ron 0.12.0 error/Identifier#(a1))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
476
477 for alt in alts {
478 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, ", {}", Identifierrust-analyzer cargo ron 0.12.0 error/Identifier#(alt))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
479 }
480
481 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, ", or {} instead", Identifierrust-analyzer cargo ron 0.12.0 error/Identifier#(an))
482 }
483 }
484 }
485 }
486
487 struct Identifierrust-analyzer cargo ron 0.12.0 error/Identifier#<'a>(&'a str);
488
489 impl<'a> fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display# for Identifierrust-analyzer cargo ron 0.12.0 error/Identifier#<'a> {
490 fn fmtrust-analyzer cargo ron 0.12.0 error/impl#[`Identifier<'a>`][Display]fmt().(&self, f: &mut fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#<'_>) -> fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Result# {
491 if self.0rust-analyzer cargo ron 0.12.0 error/Identifier#0..is_emptyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]is_empty().() || !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().self.0rust-analyzer cargo ron 0.12.0 error/Identifier#0..charsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]chars().().allrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#all().(is_ident_raw_charrust-analyzer cargo ron 0.12.0 parse/is_ident_raw_char().) {
492 return writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "{:?}_[invalid identifier]", self.0rust-analyzer cargo ron 0.12.0 error/Identifier#0.);
493 }
494
495 let mut chars = self.0rust-analyzer cargo ron 0.12.0 error/Identifier#0..charsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]chars().();
496
497 if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().chars.nextrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/iter/impl#[`Chars<'a>`][Iterator]next().().map_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]map_or().(false, is_ident_first_charrust-analyzer cargo ron 0.12.0 parse/is_ident_first_char().) || !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().chars.allrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#all().(is_xid_continuerust-analyzer cargo unicode-ident 1.0.0 is_xid_continue().) {
498 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "`r#{}`", self.0rust-analyzer cargo ron 0.12.0 error/Identifier#0.)
499 } else {
500 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "`{}`", self.0rust-analyzer cargo ron 0.12.0 error/Identifier#0.)
501 }
502 }
503 }
504
505 #[cfg(test)]
506 mod testsrust-analyzer cargo ron 0.12.0 error/tests/ {
507 use allocrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc crate/::{formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!, stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/::Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#};
508
509 use serderust-analyzer cargo serde 1.0.228 crate/::{derust-analyzer cargo serde_core 1.0.228 de/::Errorrust-analyzer cargo serde_core 1.0.228 de/Error# as DeErrorrust-analyzer cargo serde_core 1.0.228 de/Error#, derust-analyzer cargo serde_core 1.0.228 de/::Unexpectedrust-analyzer cargo serde_core 1.0.228 de/Unexpected#, serrust-analyzer cargo serde_core 1.0.228 ser/::Errorrust-analyzer cargo serde_core 1.0.228 ser/Error# as SerErrorrust-analyzer cargo serde_core 1.0.228 ser/Error#};
510
511 use superrust-analyzer cargo ron 0.12.0 error/::{Errorrust-analyzer cargo ron 0.12.0 error/Error#, Positionrust-analyzer cargo ron 0.12.0 error/Position#, Spanrust-analyzer cargo ron 0.12.0 error/Span#, SpannedErrorrust-analyzer cargo ron 0.12.0 error/SpannedError#};
512
513 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
514 fn error_messagesrust-analyzer cargo ron 0.12.0 error/tests/error_messages().() {
515 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(&Errorrust-analyzer cargo ron 0.12.0 error/Error#::fromrust-analyzer cargo ron 0.12.0 error/impl#[Error][`From<fmt::Error>`]from().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Error#), "Formatting RON failed");
516 #[cfg(feature = "std")]
517 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(
518 &Errorrust-analyzer cargo ron 0.12.0 error/Error#::fromrust-analyzer cargo ron 0.12.0 error/impl#[Error][`From<io::Error>`]from().(stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Error#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/impl#[Error]new().(
519 stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::ErrorKindrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#::InvalidDatarust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#InvalidData#,
520 "my-error",
521 )),
522 "my-error",
523 );
524 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(&<Errorrust-analyzer cargo ron 0.12.0 error/Error# as SerErrorrust-analyzer cargo serde_core 1.0.228 ser/Error#>::customrust-analyzer cargo ron 0.12.0 error/impl#[Error][Error]custom().("my-ser-error"), "my-ser-error");
525 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(&<Errorrust-analyzer cargo ron 0.12.0 error/Error# as DeErrorrust-analyzer cargo serde_core 1.0.228 de/Error#>::customrust-analyzer cargo ron 0.12.0 error/impl#[Error][Error]custom().("my-de-error"), "my-de-error");
526 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(&Errorrust-analyzer cargo ron 0.12.0 error/Error#::Eofrust-analyzer cargo ron 0.12.0 error/Error#Eof#, "Unexpected end of RON");
527 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(&Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedArrayrust-analyzer cargo ron 0.12.0 error/Error#ExpectedArray#, "Expected opening `[`");
528 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(&Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedArrayEndrust-analyzer cargo ron 0.12.0 error/Error#ExpectedArrayEnd#, "Expected closing `]`");
529 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(
530 &Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedAttributerust-analyzer cargo ron 0.12.0 error/Error#ExpectedAttribute#,
531 "Expected an `#![enable(...)]` attribute",
532 );
533 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(
534 &Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedAttributeEndrust-analyzer cargo ron 0.12.0 error/Error#ExpectedAttributeEnd#,
535 "Expected closing `)]` after the enable attribute",
536 );
537 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(&Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedBooleanrust-analyzer cargo ron 0.12.0 error/Error#ExpectedBoolean#, "Expected boolean");
538 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(&Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedCommarust-analyzer cargo ron 0.12.0 error/Error#ExpectedComma#, "Expected comma");
539 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(&Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedCharrust-analyzer cargo ron 0.12.0 error/Error#ExpectedChar#, "Expected char");
540 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(&Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedByteLiteralrust-analyzer cargo ron 0.12.0 error/Error#ExpectedByteLiteral#, "Expected byte literal");
541 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(&Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedFloatrust-analyzer cargo ron 0.12.0 error/Error#ExpectedFloat#, "Expected float");
542 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(&Errorrust-analyzer cargo ron 0.12.0 error/Error#::FloatUnderscorerust-analyzer cargo ron 0.12.0 error/Error#FloatUnderscore#, "Unexpected underscore in float");
543 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(&Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedIntegerrust-analyzer cargo ron 0.12.0 error/Error#ExpectedInteger#, "Expected integer");
544 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(&Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedOptionrust-analyzer cargo ron 0.12.0 error/Error#ExpectedOption#, "Expected option");
545 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(&Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedOptionEndrust-analyzer cargo ron 0.12.0 error/Error#ExpectedOptionEnd#, "Expected closing `)`");
546 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(&Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedStructLikeEndrust-analyzer cargo ron 0.12.0 error/Error#ExpectedStructLikeEnd#, "Expected closing `)`");
547 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(&Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedMaprust-analyzer cargo ron 0.12.0 error/Error#ExpectedMap#, "Expected opening `{`");
548 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(&Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedMapColonrust-analyzer cargo ron 0.12.0 error/Error#ExpectedMapColon#, "Expected colon");
549 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(&Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedMapEndrust-analyzer cargo ron 0.12.0 error/Error#ExpectedMapEnd#, "Expected closing `}`");
550 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(
551 &Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedDifferentStructNamerust-analyzer cargo ron 0.12.0 error/Error#ExpectedDifferentStructName# {
552 expectedrust-analyzer cargo ron 0.12.0 error/Error#ExpectedDifferentStructName#expected.: "raw+identifier",
553 foundrust-analyzer cargo ron 0.12.0 error/Error#ExpectedDifferentStructName#found.: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::fromrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`From<&str>`]from().("identifier"),
554 },
555 "Expected struct `r#raw+identifier` but found `identifier`",
556 );
557 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(&Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedStructLikerust-analyzer cargo ron 0.12.0 error/Error#ExpectedStructLike#, "Expected opening `(`");
558 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(
559 &Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedNamedStructLikerust-analyzer cargo ron 0.12.0 error/Error#ExpectedNamedStructLike#(""),
560 "Expected only opening `(`, no name, for un-nameable struct",
561 );
562 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(
563 &Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedNamedStructLikerust-analyzer cargo ron 0.12.0 error/Error#ExpectedNamedStructLike#("_ident"),
564 "Expected opening `(` for struct `_ident`",
565 );
566 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(&Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedUnitrust-analyzer cargo ron 0.12.0 error/Error#ExpectedUnit#, "Expected unit");
567 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(&Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedStringrust-analyzer cargo ron 0.12.0 error/Error#ExpectedString#, "Expected string");
568 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(&Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedByteStringrust-analyzer cargo ron 0.12.0 error/Error#ExpectedByteString#, "Expected byte string");
569 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(&Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedStringEndrust-analyzer cargo ron 0.12.0 error/Error#ExpectedStringEnd#, "Expected end of string");
570 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(&Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedIdentifierrust-analyzer cargo ron 0.12.0 error/Error#ExpectedIdentifier#, "Expected identifier");
571 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(&Errorrust-analyzer cargo ron 0.12.0 error/Error#::InvalidEscaperust-analyzer cargo ron 0.12.0 error/Error#InvalidEscape#("Invalid escape"), "Invalid escape");
572 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(&Errorrust-analyzer cargo ron 0.12.0 error/Error#::IntegerOutOfBoundsrust-analyzer cargo ron 0.12.0 error/Error#IntegerOutOfBounds#, "Integer is out of bounds");
573 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(
574 &Errorrust-analyzer cargo ron 0.12.0 error/Error#::InvalidIntegerDigitrust-analyzer cargo ron 0.12.0 error/Error#InvalidIntegerDigit# {
575 digitrust-analyzer cargo ron 0.12.0 error/Error#InvalidIntegerDigit#digit.: 'q',
576 baserust-analyzer cargo ron 0.12.0 error/Error#InvalidIntegerDigit#base.: 16,
577 },
578 "Invalid digit 'q' for base 16 integers",
579 );
580 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(
581 &Errorrust-analyzer cargo ron 0.12.0 error/Error#::NoSuchExtensionrust-analyzer cargo ron 0.12.0 error/Error#NoSuchExtension#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::fromrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`From<&str>`]from().("unknown")),
582 "No RON extension named `unknown`",
583 );
584 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(&Errorrust-analyzer cargo ron 0.12.0 error/Error#::UnclosedBlockCommentrust-analyzer cargo ron 0.12.0 error/Error#UnclosedBlockComment#, "Unclosed block comment");
585 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(
586 &Errorrust-analyzer cargo ron 0.12.0 error/Error#::UnclosedLineCommentrust-analyzer cargo ron 0.12.0 error/Error#UnclosedLineComment#,
587 "`ron::value::RawValue` cannot end in unclosed line comment, \
588 try using a block comment or adding a newline",
589 );
590 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(
591 &Errorrust-analyzer cargo ron 0.12.0 error/Error#::UnderscoreAtBeginningrust-analyzer cargo ron 0.12.0 error/Error#UnderscoreAtBeginning#,
592 "Unexpected leading underscore in a number",
593 );
594 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(&Errorrust-analyzer cargo ron 0.12.0 error/Error#::UnexpectedCharrust-analyzer cargo ron 0.12.0 error/Error#UnexpectedChar#('🦀'), "Unexpected char \'🦀\'");
595 #[allow(invalid_from_utf8)]
596 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(
597 &Errorrust-analyzer cargo ron 0.12.0 error/Error#::Utf8Errorrust-analyzer cargo ron 0.12.0 error/Error#Utf8Error#(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/::from_utf8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/converts/from_utf8().(b"error: \xff\xff\xff\xff").unwrap_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap_err().()),
598 "invalid utf-8 sequence of 1 bytes from index 7",
599 );
600 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(
601 &Errorrust-analyzer cargo ron 0.12.0 error/Error#::TrailingCharactersrust-analyzer cargo ron 0.12.0 error/Error#TrailingCharacters#,
602 "Non-whitespace trailing characters",
603 );
604 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(
605 &Errorrust-analyzer cargo ron 0.12.0 error/Error#::invalid_valuerust-analyzer cargo ron 0.12.0 error/impl#[Error][Error]invalid_value().(Unexpectedrust-analyzer cargo serde_core 1.0.228 de/Unexpected#::Enumrust-analyzer cargo serde_core 1.0.228 de/Unexpected#Enum#, &"struct `Hi`"),
606 "Expected struct `Hi` but found an enum instead",
607 );
608 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(
609 &Errorrust-analyzer cargo ron 0.12.0 error/Error#::invalid_lengthrust-analyzer cargo ron 0.12.0 error/impl#[Error][Error]invalid_length().(0, &"two bees"),
610 "Expected two bees but found zero elements instead",
611 );
612 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(
613 &Errorrust-analyzer cargo ron 0.12.0 error/Error#::invalid_lengthrust-analyzer cargo ron 0.12.0 error/impl#[Error][Error]invalid_length().(1, &"two bees"),
614 "Expected two bees but found one element instead",
615 );
616 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(
617 &Errorrust-analyzer cargo ron 0.12.0 error/Error#::invalid_lengthrust-analyzer cargo ron 0.12.0 error/impl#[Error][Error]invalid_length().(3, &"two bees"),
618 "Expected two bees but found 3 elements instead",
619 );
620 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(
621 &Errorrust-analyzer cargo ron 0.12.0 error/Error#::unknown_variantrust-analyzer cargo ron 0.12.0 error/impl#[Error][Error]unknown_variant().("unknown", &[]),
622 "Unexpected enum variant named `unknown`, there are no variants",
623 );
624 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(
625 &Errorrust-analyzer cargo ron 0.12.0 error/Error#::NoSuchEnumVariantrust-analyzer cargo ron 0.12.0 error/Error#NoSuchEnumVariant# {
626 expectedrust-analyzer cargo ron 0.12.0 error/Error#NoSuchEnumVariant#expected.: &["A", "B+C"],
627 foundrust-analyzer cargo ron 0.12.0 error/Error#NoSuchEnumVariant#found.: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::fromrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`From<&str>`]from().("D"),
628 outerrust-analyzer cargo ron 0.12.0 error/Error#NoSuchEnumVariant#outer.: Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::fromrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`From<&str>`]from().("E")),
629 },
630 "Unexpected variant named `D` in enum `E`, \
631 expected either `A` or `r#B+C` instead",
632 );
633 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(
634 &Errorrust-analyzer cargo ron 0.12.0 error/Error#::unknown_fieldrust-analyzer cargo ron 0.12.0 error/impl#[Error][Error]unknown_field().("unknown", &[]),
635 "Unexpected field named `unknown`, there are no fields",
636 );
637 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(
638 &Errorrust-analyzer cargo ron 0.12.0 error/Error#::NoSuchStructFieldrust-analyzer cargo ron 0.12.0 error/Error#NoSuchStructField# {
639 expectedrust-analyzer cargo ron 0.12.0 error/Error#NoSuchStructField#expected.: &["a"],
640 foundrust-analyzer cargo ron 0.12.0 error/Error#NoSuchStructField#found.: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::fromrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`From<&str>`]from().("b"),
641 outerrust-analyzer cargo ron 0.12.0 error/Error#NoSuchStructField#outer.: Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::fromrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`From<&str>`]from().("S")),
642 },
643 "Unexpected field named `b` in `S`, expected `a` instead",
644 );
645 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(
646 &Errorrust-analyzer cargo ron 0.12.0 error/Error#::NoSuchStructFieldrust-analyzer cargo ron 0.12.0 error/Error#NoSuchStructField# {
647 expectedrust-analyzer cargo ron 0.12.0 error/Error#NoSuchStructField#expected.: &["a", "b+c", "d"],
648 foundrust-analyzer cargo ron 0.12.0 error/Error#NoSuchStructField#found.: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::fromrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`From<&str>`]from().("e"),
649 outerrust-analyzer cargo ron 0.12.0 error/Error#NoSuchStructField#outer.: Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::fromrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`From<&str>`]from().("S")),
650 },
651 "Unexpected field named `e` in `S`, \
652 expected one of `a`, `r#b+c`, or `d` instead",
653 );
654 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(
655 &Errorrust-analyzer cargo ron 0.12.0 error/Error#::missing_fieldrust-analyzer cargo ron 0.12.0 error/impl#[Error][Error]missing_field().("a"),
656 "Unexpected missing field named `a`",
657 );
658 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(
659 &Errorrust-analyzer cargo ron 0.12.0 error/Error#::MissingStructFieldrust-analyzer cargo ron 0.12.0 error/Error#MissingStructField# {
660 fieldrust-analyzer cargo ron 0.12.0 error/Error#MissingStructField#field.: "",
661 outerrust-analyzer cargo ron 0.12.0 error/Error#MissingStructField#outer.: Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::fromrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`From<&str>`]from().("S+T")),
662 },
663 "Unexpected missing field named \"\"_[invalid identifier] in `r#S+T`",
664 );
665 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(
666 &Errorrust-analyzer cargo ron 0.12.0 error/Error#::duplicate_fieldrust-analyzer cargo ron 0.12.0 error/impl#[Error][Error]duplicate_field().("a"),
667 "Unexpected duplicate field named `a`",
668 );
669 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(
670 &Errorrust-analyzer cargo ron 0.12.0 error/Error#::DuplicateStructFieldrust-analyzer cargo ron 0.12.0 error/Error#DuplicateStructField# {
671 fieldrust-analyzer cargo ron 0.12.0 error/Error#DuplicateStructField#field.: "b+c",
672 outerrust-analyzer cargo ron 0.12.0 error/Error#DuplicateStructField#outer.: Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::fromrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`From<&str>`]from().("S+T")),
673 },
674 "Unexpected duplicate field named `r#b+c` in `r#S+T`",
675 );
676 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(
677 &Errorrust-analyzer cargo ron 0.12.0 error/Error#::InvalidIdentifierrust-analyzer cargo ron 0.12.0 error/Error#InvalidIdentifier#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::fromrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`From<&str>`]from().("why+🦀+not")),
678 "Invalid identifier \"why+🦀+not\"",
679 );
680 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(
681 &Errorrust-analyzer cargo ron 0.12.0 error/Error#::SuggestRawIdentifierrust-analyzer cargo ron 0.12.0 error/Error#SuggestRawIdentifier#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::fromrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`From<&str>`]from().("raw+ident")),
682 "Found invalid std identifier \"raw+ident\", \
683 try the raw identifier `r#raw+ident` instead",
684 );
685 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(
686 &Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedRawValuerust-analyzer cargo ron 0.12.0 error/Error#ExpectedRawValue#,
687 "Expected a `ron::value::RawValue`",
688 );
689 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(
690 &Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExceededRecursionLimitrust-analyzer cargo ron 0.12.0 error/Error#ExceededRecursionLimit#,
691 "Exceeded recursion limit, try increasing `ron::Options::recursion_limit` \
692 and using `serde_stacker` to protect against a stack overflow",
693 );
694 check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().(
695 &Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedStructNamerust-analyzer cargo ron 0.12.0 error/Error#ExpectedStructName#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::fromrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`From<&str>`]from().("Struct")),
696 "Expected the explicit struct name `Struct`, but none was found",
697 );
698 }
699
700 fn check_error_messagerust-analyzer cargo ron 0.12.0 error/tests/check_error_message().<T: corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display#>(err: &T, msg: &str) {
701 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{}", err), msg);
702 }
703
704 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
705 fn spanned_error_into_coderust-analyzer cargo ron 0.12.0 error/tests/spanned_error_into_code().() {
706 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
707 Errorrust-analyzer cargo ron 0.12.0 error/Error#::fromrust-analyzer cargo ron 0.12.0 error/impl#[Error][`From<SpannedError>`]from().(SpannedErrorrust-analyzer cargo ron 0.12.0 error/SpannedError# {
708 coderust-analyzer cargo ron 0.12.0 error/SpannedError#code.: Errorrust-analyzer cargo ron 0.12.0 error/Error#::Eofrust-analyzer cargo ron 0.12.0 error/Error#Eof#,
709 spanrust-analyzer cargo ron 0.12.0 error/SpannedError#span.: Spanrust-analyzer cargo ron 0.12.0 error/Span# {
710 startrust-analyzer cargo ron 0.12.0 error/Span#start.: Positionrust-analyzer cargo ron 0.12.0 error/Position# { linerust-analyzer cargo ron 0.12.0 error/Position#line.: 1, colrust-analyzer cargo ron 0.12.0 error/Position#col.: 1 },
711 endrust-analyzer cargo ron 0.12.0 error/Span#end.: Positionrust-analyzer cargo ron 0.12.0 error/Position# { linerust-analyzer cargo ron 0.12.0 error/Position#line.: 1, colrust-analyzer cargo ron 0.12.0 error/Position#col.: 5 },
712 }
713 }),
714 Errorrust-analyzer cargo ron 0.12.0 error/Error#::Eofrust-analyzer cargo ron 0.12.0 error/Error#Eof#
715 );
716 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
717 Errorrust-analyzer cargo ron 0.12.0 error/Error#::fromrust-analyzer cargo ron 0.12.0 error/impl#[Error][`From<SpannedError>`]from().(SpannedErrorrust-analyzer cargo ron 0.12.0 error/SpannedError# {
718 coderust-analyzer cargo ron 0.12.0 error/SpannedError#code.: Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedRawValuerust-analyzer cargo ron 0.12.0 error/Error#ExpectedRawValue#,
719 spanrust-analyzer cargo ron 0.12.0 error/SpannedError#span.: Spanrust-analyzer cargo ron 0.12.0 error/Span# {
720 startrust-analyzer cargo ron 0.12.0 error/Span#start.: Positionrust-analyzer cargo ron 0.12.0 error/Position# { linerust-analyzer cargo ron 0.12.0 error/Position#line.: 1, colrust-analyzer cargo ron 0.12.0 error/Position#col.: 1 },
721 endrust-analyzer cargo ron 0.12.0 error/Span#end.: Positionrust-analyzer cargo ron 0.12.0 error/Position# { linerust-analyzer cargo ron 0.12.0 error/Position#line.: 1, colrust-analyzer cargo ron 0.12.0 error/Position#col.: 5 },
722 }
723 }),
724 Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedRawValuerust-analyzer cargo ron 0.12.0 error/Error#ExpectedRawValue#
725 );
726 }
727 }