@@ -219,7 +219,7 @@ fn is_ident_or_underscore(t: &token::Token) -> bool {
219219pub struct ModulePath {
220220 pub name : String ,
221221 pub path_exists : bool ,
222- pub result : Result < ModulePathSuccess , Errors > ,
222+ pub result : Result < ModulePathSuccess , Error > ,
223223}
224224
225225pub struct ModulePathSuccess {
@@ -233,7 +233,7 @@ pub struct ModulePathError {
233233 pub help_msg : String ,
234234}
235235
236- pub enum Errors {
236+ pub enum Error {
237237 FileNotFoundForModule {
238238 mod_name : String ,
239239 default_path : String ,
@@ -249,13 +249,13 @@ pub enum Errors {
249249 InclusiveRangeWithNoEnd ,
250250}
251251
252- impl Errors {
252+ impl Error {
253253 pub fn span_err < ' a > ( self , sp : Span , handler : & ' a errors:: Handler ) -> DiagnosticBuilder < ' a > {
254254 match self {
255- Errors :: FileNotFoundForModule { ref mod_name,
256- ref default_path,
257- ref secondary_path,
258- ref dir_path } => {
255+ Error :: FileNotFoundForModule { ref mod_name,
256+ ref default_path,
257+ ref secondary_path,
258+ ref dir_path } => {
259259 let mut err = struct_span_err ! ( handler, sp, E0583 ,
260260 "file not found for module `{}`" , mod_name) ;
261261 err. help ( & format ! ( "name the file either {} or {} inside the directory {:?}" ,
@@ -264,7 +264,7 @@ impl Errors {
264264 dir_path) ) ;
265265 err
266266 }
267- Errors :: DuplicatePaths { ref mod_name, ref default_path, ref secondary_path } => {
267+ Error :: DuplicatePaths { ref mod_name, ref default_path, ref secondary_path } => {
268268 let mut err = struct_span_err ! ( handler, sp, E0584 ,
269269 "file for module `{}` found at both {} and {}" ,
270270 mod_name,
@@ -273,14 +273,14 @@ impl Errors {
273273 err. help ( "delete or rename one of them to remove the ambiguity" ) ;
274274 err
275275 }
276- Errors :: UselessDocComment => {
276+ Error :: UselessDocComment => {
277277 let mut err = struct_span_err ! ( handler, sp, E0585 ,
278278 "found a documentation comment that doesn't document anything" ) ;
279279 err. help ( "doc comments must come before what they document, maybe a comment was \
280280 intended with `//`?") ;
281281 err
282282 }
283- Errors :: InclusiveRangeWithNoEnd => {
283+ Error :: InclusiveRangeWithNoEnd => {
284284 let mut err = struct_span_err ! ( handler, sp, E0586 ,
285285 "inclusive range with no end" ) ;
286286 err. help ( "inclusive ranges must be bounded at the end (`...b` or `a...b`)" ) ;
@@ -518,7 +518,7 @@ impl<'a> Parser<'a> {
518518 }
519519 _ => {
520520 Err ( if self . prev_token_kind == PrevTokenKind :: DocComment {
521- self . span_fatal_err ( self . prev_span , Errors :: UselessDocComment )
521+ self . span_fatal_err ( self . prev_span , Error :: UselessDocComment )
522522 } else {
523523 let mut err = self . fatal ( & format ! ( "expected identifier, found `{}`" ,
524524 self . this_token_to_string( ) ) ) ;
@@ -1009,7 +1009,7 @@ impl<'a> Parser<'a> {
10091009 pub fn span_fatal ( & self , sp : Span , m : & str ) -> DiagnosticBuilder < ' a > {
10101010 self . sess . span_diagnostic . struct_span_fatal ( sp, m)
10111011 }
1012- pub fn span_fatal_err ( & self , sp : Span , err : Errors ) -> DiagnosticBuilder < ' a > {
1012+ pub fn span_fatal_err ( & self , sp : Span , err : Error ) -> DiagnosticBuilder < ' a > {
10131013 err. span_err ( sp, self . diagnostic ( ) )
10141014 }
10151015 pub fn span_fatal_help ( & self , sp : Span , m : & str , help : & str ) -> DiagnosticBuilder < ' a > {
@@ -2001,7 +2001,7 @@ impl<'a> Parser<'a> {
20012001 limits : RangeLimits )
20022002 -> PResult < ' a , ast:: ExprKind > {
20032003 if end. is_none ( ) && limits == RangeLimits :: Closed {
2004- Err ( self . span_fatal_err ( self . span , Errors :: InclusiveRangeWithNoEnd ) )
2004+ Err ( self . span_fatal_err ( self . span , Error :: InclusiveRangeWithNoEnd ) )
20052005 } else {
20062006 Ok ( ExprKind :: Range ( start, end, limits) )
20072007 }
@@ -3916,7 +3916,7 @@ impl<'a> Parser<'a> {
39163916 let unused_attrs = |attrs : & [ _ ] , s : & mut Self | {
39173917 if attrs. len ( ) > 0 {
39183918 if s. prev_token_kind == PrevTokenKind :: DocComment {
3919- self . span_fatal_err ( s. prev_span , Errors :: UselessDocComment ) . emit ( ) ;
3919+ s . span_fatal_err ( s. prev_span , Error :: UselessDocComment ) . emit ( ) ;
39203920 } else {
39213921 s. span_err ( s. span , "expected statement after outer attribute" ) ;
39223922 }
@@ -5050,7 +5050,7 @@ impl<'a> Parser<'a> {
50505050 }
50515051 token:: CloseDelim ( token:: Brace ) => { }
50525052 token:: DocComment ( _) => return Err ( self . span_fatal_err ( self . span ,
5053- Errors :: UselessDocComment ) ) ,
5053+ Error :: UselessDocComment ) ) ,
50545054 _ => return Err ( self . span_fatal_help ( self . span ,
50555055 & format ! ( "expected `,`, or `}}`, found `{}`" , self . this_token_to_string( ) ) ,
50565056 "struct fields should be separated by commas" ) ) ,
@@ -5231,13 +5231,13 @@ impl<'a> Parser<'a> {
52315231 directory_ownership : DirectoryOwnership :: Owned ,
52325232 warn : false ,
52335233 } ) ,
5234- ( false , false ) => Err ( Errors :: FileNotFoundForModule {
5234+ ( false , false ) => Err ( Error :: FileNotFoundForModule {
52355235 mod_name : mod_name. clone ( ) ,
52365236 default_path : default_path_str,
52375237 secondary_path : secondary_path_str,
52385238 dir_path : format ! ( "{}" , dir_path. display( ) ) ,
52395239 } ) ,
5240- ( true , true ) => Err ( Errors :: DuplicatePaths {
5240+ ( true , true ) => Err ( Error :: DuplicatePaths {
52415241 mod_name : mod_name. clone ( ) ,
52425242 default_path : default_path_str,
52435243 secondary_path : secondary_path_str,
0 commit comments