@@ -1034,8 +1034,6 @@ enum PathResult<'a> {
10341034 NonModule ( PathResolution ) ,
10351035 Indeterminate ,
10361036 Failed ( Span , String , bool /* is the error from the last segment? */ ) ,
1037- /// Encountered an error that is reported elsewhere
1038- Ignore ,
10391037}
10401038
10411039enum ModuleKind {
@@ -1768,7 +1766,6 @@ impl<'a> Resolver<'a> {
17681766 error_callback ( self , span, ResolutionError :: FailedToResolve ( & msg) ) ;
17691767 Def :: Err
17701768 }
1771- PathResult :: Ignore => Def :: Err ,
17721769 } ;
17731770
17741771 let segments: Vec < _ > = segments. iter ( ) . map ( |seg| {
@@ -3696,7 +3693,7 @@ impl<'a> Resolver<'a> {
36963693 resolve_error ( self , span, ResolutionError :: FailedToResolve ( & msg) ) ;
36973694 err_path_resolution ( )
36983695 }
3699- PathResult :: Module ( ..) | PathResult :: Failed ( ..) | PathResult :: Ignore => return None ,
3696+ PathResult :: Module ( ..) | PathResult :: Failed ( ..) => return None ,
37003697 PathResult :: Indeterminate => bug ! ( "indetermined path result in resolve_qpath" ) ,
37013698 } ;
37023699
@@ -3928,11 +3925,11 @@ impl<'a> Resolver<'a> {
39283925 } ) ;
39293926 if let Some ( candidate) = candidates. get ( 0 ) {
39303927 format ! ( "did you mean `{}`?" , candidate. path)
3931- } else if !ident. is_used_keyword ( ) {
3928+ } else if !ident. is_reserved ( ) {
39323929 format ! ( "maybe a missing `extern crate {};`?" , ident)
39333930 } else {
39343931 // the parser will already have complained about the keyword being used
3935- return PathResult :: Ignore ;
3932+ return PathResult :: NonModule ( err_path_resolution ( ) ) ;
39363933 }
39373934 } else if i == 0 {
39383935 format ! ( "use of undeclared type or module `{}`" , ident)
0 commit comments