]> git.proxmox.com Git - cargo.git/blobdiff - vendor/regex-syntax/src/error.rs
New upstream version 0.52.0
[cargo.git] / vendor / regex-syntax / src / error.rs
index 93c2b0dd9332e482a6292669344a84bd5051607c..71cfa426a8299e61e38b0fa0ee14dd10f35d2128 100644 (file)
@@ -3,8 +3,8 @@ use std::error;
 use std::fmt;
 use std::result;
 
-use ast;
-use hir;
+use crate::ast;
+use crate::hir;
 
 /// A type alias for dealing with errors returned by this crate.
 pub type Result<T> = result::Result<T, Error>;
@@ -52,7 +52,7 @@ impl error::Error for Error {
 }
 
 impl fmt::Display for Error {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         match *self {
             Error::Parse(ref x) => x.fmt(f),
             Error::Translate(ref x) => x.fmt(f),
@@ -67,7 +67,7 @@ impl fmt::Display for Error {
 /// readable format. Most of its complexity is from interspersing notational
 /// markers pointing out the position where an error occurred.
 #[derive(Debug)]
-pub struct Formatter<'e, E: 'e> {
+pub struct Formatter<'e, E> {
     /// The original regex pattern in which the error occurred.
     pattern: &'e str,
     /// The error kind. It must impl fmt::Display.
@@ -102,7 +102,7 @@ impl<'e> From<&'e hir::Error> for Formatter<'e, hir::ErrorKind> {
 }
 
 impl<'e, E: fmt::Display> fmt::Display for Formatter<'e, E> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         let spans = Spans::from_formatter(self);
         if self.pattern.contains('\n') {
             let divider = repeat_char('~', 79);
@@ -286,7 +286,7 @@ fn repeat_char(c: char, count: usize) -> String {
 
 #[cfg(test)]
 mod tests {
-    use ast::parse::Parser;
+    use crate::ast::parse::Parser;
 
     fn assert_panic_message(pattern: &str, expected_msg: &str) -> () {
         let result = Parser::new().parse(pattern);