diff options
Diffstat (limited to 'compiler/rustc_resolve/src/lib.rs')
| -rw-r--r-- | compiler/rustc_resolve/src/lib.rs | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/compiler/rustc_resolve/src/lib.rs b/compiler/rustc_resolve/src/lib.rs index 0adea65ee58..90aa7d79bf0 100644 --- a/compiler/rustc_resolve/src/lib.rs +++ b/compiler/rustc_resolve/src/lib.rs @@ -213,7 +213,7 @@ enum ResolutionError<'a> { SelfImportOnlyInImportListWithNonEmptyPrefix, /// Error E0433: failed to resolve. FailedToResolve { - last_segment: Option<Symbol>, + segment: Option<Symbol>, label: String, suggestion: Option<Suggestion>, module: Option<ModuleOrUniformRoot<'a>>, @@ -396,12 +396,14 @@ enum PathResult<'a> { suggestion: Option<Suggestion>, is_error_from_last_segment: bool, module: Option<ModuleOrUniformRoot<'a>>, + /// The segment name of target + segment_name: Symbol, }, } impl<'a> PathResult<'a> { fn failed( - span: Span, + ident: Ident, is_error_from_last_segment: bool, finalize: bool, module: Option<ModuleOrUniformRoot<'a>>, @@ -409,7 +411,14 @@ impl<'a> PathResult<'a> { ) -> PathResult<'a> { let (label, suggestion) = if finalize { label_and_suggestion() } else { (String::new(), None) }; - PathResult::Failed { span, label, suggestion, is_error_from_last_segment, module } + PathResult::Failed { + span: ident.span, + segment_name: ident.name, + label, + suggestion, + is_error_from_last_segment, + module, + } } } |
