@@ -1034,8 +1034,6 @@ enum PathResult<'a> {
1034
1034
NonModule ( PathResolution ) ,
1035
1035
Indeterminate ,
1036
1036
Failed ( Span , String , bool /* is the error from the last segment? */ ) ,
1037
- /// Encountered an error that is reported elsewhere
1038
- Ignore ,
1039
1037
}
1040
1038
1041
1039
enum ModuleKind {
@@ -1768,7 +1766,6 @@ impl<'a> Resolver<'a> {
1768
1766
error_callback ( self , span, ResolutionError :: FailedToResolve ( & msg) ) ;
1769
1767
Def :: Err
1770
1768
}
1771
- PathResult :: Ignore => Def :: Err ,
1772
1769
} ;
1773
1770
1774
1771
let segments: Vec < _ > = segments. iter ( ) . map ( |seg| {
@@ -3696,7 +3693,7 @@ impl<'a> Resolver<'a> {
3696
3693
resolve_error ( self , span, ResolutionError :: FailedToResolve ( & msg) ) ;
3697
3694
err_path_resolution ( )
3698
3695
}
3699
- PathResult :: Module ( ..) | PathResult :: Failed ( ..) | PathResult :: Ignore => return None ,
3696
+ PathResult :: Module ( ..) | PathResult :: Failed ( ..) => return None ,
3700
3697
PathResult :: Indeterminate => bug ! ( "indetermined path result in resolve_qpath" ) ,
3701
3698
} ;
3702
3699
@@ -3928,11 +3925,11 @@ impl<'a> Resolver<'a> {
3928
3925
} ) ;
3929
3926
if let Some ( candidate) = candidates. get ( 0 ) {
3930
3927
format ! ( "did you mean `{}`?" , candidate. path)
3931
- } else if !ident. is_used_keyword ( ) {
3928
+ } else if !ident. is_reserved ( ) {
3932
3929
format ! ( "maybe a missing `extern crate {};`?" , ident)
3933
3930
} else {
3934
3931
// the parser will already have complained about the keyword being used
3935
- return PathResult :: Ignore ;
3932
+ return PathResult :: NonModule ( err_path_resolution ( ) ) ;
3936
3933
}
3937
3934
} else if i == 0 {
3938
3935
format ! ( "use of undeclared type or module `{}`" , ident)
0 commit comments