@@ -279,7 +279,7 @@ impl<'a> Resolver<'a> {
279279 mut ident : Ident ,
280280 ns : Namespace ,
281281 parent_scope : & ParentScope < ' a > ,
282- finalize_full : Option < Finalize > ,
282+ finalize : Option < Finalize > ,
283283 ribs : & [ Rib < ' a > ] ,
284284 unusable_binding : Option < & ' a NameBinding < ' a > > ,
285285 ) -> Option < LexicalScopeBinding < ' a > > {
@@ -302,7 +302,6 @@ impl<'a> Resolver<'a> {
302302 let normalized_ident = Ident { span : normalized_span, ..ident } ;
303303
304304 // Walk backwards up the ribs in scope.
305- let finalize = finalize_full. map ( |finalize| finalize. path_span ) ;
306305 let mut module = self . graph_root ;
307306 for i in ( 0 ..ribs. len ( ) ) . rev ( ) {
308307 debug ! ( "walk rib\n {:?}" , ribs[ i] . bindings) ;
@@ -316,7 +315,7 @@ impl<'a> Resolver<'a> {
316315 i,
317316 rib_ident,
318317 * res,
319- finalize,
318+ finalize. map ( |finalize| finalize . path_span ) ,
320319 * original_rib_ident_def,
321320 ribs,
322321 ) ) ) ;
@@ -354,7 +353,7 @@ impl<'a> Resolver<'a> {
354353 }
355354 self . early_resolve_ident_in_lexical_scope (
356355 orig_ident,
357- ScopeSet :: Late ( ns, module, finalize_full . map ( |finalize| finalize. node_id ) ) ,
356+ ScopeSet :: Late ( ns, module, finalize . map ( |finalize| finalize. node_id ) ) ,
358357 parent_scope,
359358 finalize,
360359 finalize. is_some ( ) ,
@@ -376,7 +375,7 @@ impl<'a> Resolver<'a> {
376375 orig_ident : Ident ,
377376 scope_set : ScopeSet < ' a > ,
378377 parent_scope : & ParentScope < ' a > ,
379- finalize : Option < Span > ,
378+ finalize : Option < Finalize > ,
380379 force : bool ,
381380 last_import_segment : bool ,
382381 unusable_binding : Option < & ' a NameBinding < ' a > > ,
@@ -742,7 +741,7 @@ impl<'a> Resolver<'a> {
742741 ident : Ident ,
743742 ns : Namespace ,
744743 parent_scope : & ParentScope < ' a > ,
745- finalize : Option < Span > ,
744+ finalize : Option < Finalize > ,
746745 // We are resolving a last import segment during import validation.
747746 last_import_segment : bool ,
748747 // This binding should be ignored during in-module resolution, so that we don't get
@@ -768,7 +767,7 @@ impl<'a> Resolver<'a> {
768767 mut ident : Ident ,
769768 ns : Namespace ,
770769 parent_scope : & ParentScope < ' a > ,
771- finalize : Option < Span > ,
770+ finalize : Option < Finalize > ,
772771 last_import_segment : bool ,
773772 unusable_binding : Option < & ' a NameBinding < ' a > > ,
774773 ) -> Result < & ' a NameBinding < ' a > , ( Determinacy , Weak ) > {
@@ -808,7 +807,7 @@ impl<'a> Resolver<'a> {
808807 ident : Ident ,
809808 ns : Namespace ,
810809 parent_scope : & ParentScope < ' a > ,
811- finalize : Option < Span > ,
810+ finalize : Option < Finalize > ,
812811 last_import_segment : bool ,
813812 unusable_binding : Option < & ' a NameBinding < ' a > > ,
814813 ) -> Result < & ' a NameBinding < ' a > , Determinacy > {
@@ -835,7 +834,7 @@ impl<'a> Resolver<'a> {
835834 ns : Namespace ,
836835 parent_scope : & ParentScope < ' a > ,
837836 restricted_shadowing : bool ,
838- finalize : Option < Span > ,
837+ finalize : Option < Finalize > ,
839838 last_import_segment : bool ,
840839 unusable_binding : Option < & ' a NameBinding < ' a > > ,
841840 ) -> Result < & ' a NameBinding < ' a > , ( Determinacy , Weak ) > {
@@ -901,7 +900,7 @@ impl<'a> Resolver<'a> {
901900 let resolution =
902901 self . resolution ( module, key) . try_borrow_mut ( ) . map_err ( |_| ( Determined , Weak :: No ) ) ?; // This happens when there is a cycle of imports.
903902
904- if let Some ( path_span) = finalize {
903+ if let Some ( Finalize { path_span, .. } ) = finalize {
905904 // If the primary binding is unusable, search further and return the shadowed glob
906905 // binding if it exists. What we really want here is having two separate scopes in
907906 // a module - one for non-globs and one for globs, but until that's done use this
@@ -1391,13 +1390,12 @@ impl<'a> Resolver<'a> {
13911390 path : & [ Segment ] ,
13921391 opt_ns : Option < Namespace > , // `None` indicates a module path in import
13931392 parent_scope : & ParentScope < ' a > ,
1394- finalize_full : Option < Finalize > ,
1393+ finalize : Option < Finalize > ,
13951394 ribs : Option < & PerNS < Vec < Rib < ' a > > > > ,
13961395 unusable_binding : Option < & ' a NameBinding < ' a > > ,
13971396 ) -> PathResult < ' a > {
1398- debug ! ( "resolve_path(path={:?}, opt_ns={:?}, finalize={:?})" , path, opt_ns, finalize_full ) ;
1397+ debug ! ( "resolve_path(path={:?}, opt_ns={:?}, finalize={:?})" , path, opt_ns, finalize ) ;
13991398
1400- let finalize = finalize_full. map ( |finalize| finalize. path_span ) ;
14011399 let mut module = None ;
14021400 let mut allow_super = true ;
14031401 let mut second_binding = None ;
@@ -1507,7 +1505,7 @@ impl<'a> Resolver<'a> {
15071505 ident,
15081506 ns,
15091507 parent_scope,
1510- finalize_full ,
1508+ finalize ,
15111509 & ribs[ ns] ,
15121510 unusable_binding,
15131511 ) {
@@ -1566,7 +1564,7 @@ impl<'a> Resolver<'a> {
15661564 } else if res == Res :: Err {
15671565 return PathResult :: NonModule ( PartialRes :: new ( Res :: Err ) ) ;
15681566 } else if opt_ns. is_some ( ) && ( is_last || maybe_assoc) {
1569- self . lint_if_path_starts_with_module ( finalize_full , path, second_binding) ;
1567+ self . lint_if_path_starts_with_module ( finalize , path, second_binding) ;
15701568 return PathResult :: NonModule ( PartialRes :: with_unresolved_segments (
15711569 res,
15721570 path. len ( ) - i - 1 ,
@@ -1609,7 +1607,7 @@ impl<'a> Resolver<'a> {
16091607 }
16101608 }
16111609
1612- self . lint_if_path_starts_with_module ( finalize_full , path, second_binding) ;
1610+ self . lint_if_path_starts_with_module ( finalize , path, second_binding) ;
16131611
16141612 PathResult :: Module ( match module {
16151613 Some ( module) => module,
0 commit comments