@@ -3,7 +3,6 @@ Defines an abstract syntax for regular expressions.
3
3
*/
4
4
5
5
use std:: cmp:: Ordering ;
6
- use std:: error;
7
6
use std:: fmt;
8
7
9
8
pub use crate :: ast:: visitor:: { visit, Visitor } ;
@@ -178,46 +177,7 @@ pub enum ErrorKind {
178
177
__Nonexhaustive,
179
178
}
180
179
181
- impl error:: Error for Error {
182
- // TODO: Remove this method entirely on the next breaking semver release.
183
- #[ allow( deprecated) ]
184
- fn description ( & self ) -> & str {
185
- use self :: ErrorKind :: * ;
186
- match self . kind {
187
- CaptureLimitExceeded => "capture group limit exceeded" ,
188
- ClassEscapeInvalid => "invalid escape sequence in character class" ,
189
- ClassRangeInvalid => "invalid character class range" ,
190
- ClassRangeLiteral => "invalid range boundary, must be a literal" ,
191
- ClassUnclosed => "unclosed character class" ,
192
- DecimalEmpty => "empty decimal literal" ,
193
- DecimalInvalid => "invalid decimal literal" ,
194
- EscapeHexEmpty => "empty hexadecimal literal" ,
195
- EscapeHexInvalid => "invalid hexadecimal literal" ,
196
- EscapeHexInvalidDigit => "invalid hexadecimal digit" ,
197
- EscapeUnexpectedEof => "unexpected eof (escape sequence)" ,
198
- EscapeUnrecognized => "unrecognized escape sequence" ,
199
- FlagDanglingNegation => "dangling flag negation operator" ,
200
- FlagDuplicate { .. } => "duplicate flag" ,
201
- FlagRepeatedNegation { .. } => "repeated negation" ,
202
- FlagUnexpectedEof => "unexpected eof (flag)" ,
203
- FlagUnrecognized => "unrecognized flag" ,
204
- GroupNameDuplicate { .. } => "duplicate capture group name" ,
205
- GroupNameEmpty => "empty capture group name" ,
206
- GroupNameInvalid => "invalid capture group name" ,
207
- GroupNameUnexpectedEof => "unclosed capture group name" ,
208
- GroupUnclosed => "unclosed group" ,
209
- GroupUnopened => "unopened group" ,
210
- NestLimitExceeded ( _) => "nest limit exceeded" ,
211
- RepetitionCountInvalid => "invalid repetition count range" ,
212
- RepetitionCountUnclosed => "unclosed counted repetition" ,
213
- RepetitionMissing => "repetition operator missing expression" ,
214
- UnicodeClassInvalid => "invalid Unicode character class" ,
215
- UnsupportedBackreference => "backreferences are not supported" ,
216
- UnsupportedLookAround => "look-around is not supported" ,
217
- _ => unreachable ! ( ) ,
218
- }
219
- }
220
- }
180
+ impl std:: error:: Error for Error { }
221
181
222
182
impl fmt:: Display for Error {
223
183
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
0 commit comments