@@ -343,7 +343,6 @@ impl<'a> Resolver<'a> {
343343 ns,
344344 parent_scope,
345345 finalize,
346- false ,
347346 unusable_binding,
348347 ) ;
349348 if let Ok ( binding) = item {
@@ -357,7 +356,6 @@ impl<'a> Resolver<'a> {
357356 parent_scope,
358357 finalize,
359358 finalize. is_some ( ) ,
360- false ,
361359 unusable_binding,
362360 )
363361 . ok ( )
@@ -377,7 +375,6 @@ impl<'a> Resolver<'a> {
377375 parent_scope : & ParentScope < ' a > ,
378376 finalize : Option < Finalize > ,
379377 force : bool ,
380- last_import_segment : bool ,
381378 unusable_binding : Option < & ' a NameBinding < ' a > > ,
382379 ) -> Result < & ' a NameBinding < ' a > , Determinacy > {
383380 bitflags:: bitflags! {
@@ -498,7 +495,6 @@ impl<'a> Resolver<'a> {
498495 ns,
499496 parent_scope,
500497 finalize,
501- last_import_segment,
502498 unusable_binding,
503499 ) ;
504500 match binding {
@@ -521,7 +517,6 @@ impl<'a> Resolver<'a> {
521517 adjusted_parent_scope,
522518 !matches ! ( scope_set, ScopeSet :: Late ( ..) ) ,
523519 finalize,
524- last_import_segment,
525520 unusable_binding,
526521 ) ;
527522 match binding {
@@ -607,7 +602,6 @@ impl<'a> Resolver<'a> {
607602 ns,
608603 parent_scope,
609604 None ,
610- last_import_segment,
611605 unusable_binding,
612606 ) {
613607 if use_prelude || this. is_builtin_macro ( binding. res ( ) ) {
@@ -730,7 +724,7 @@ impl<'a> Resolver<'a> {
730724 ns : Namespace ,
731725 parent_scope : & ParentScope < ' a > ,
732726 ) -> Result < & ' a NameBinding < ' a > , Determinacy > {
733- self . resolve_ident_in_module_ext ( module, ident, ns, parent_scope, None , false , None )
727+ self . resolve_ident_in_module_ext ( module, ident, ns, parent_scope, None , None )
734728 . map_err ( |( determinacy, _) | determinacy)
735729 }
736730
@@ -742,8 +736,6 @@ impl<'a> Resolver<'a> {
742736 ns : Namespace ,
743737 parent_scope : & ParentScope < ' a > ,
744738 finalize : Option < Finalize > ,
745- // We are resolving a last import segment during import validation.
746- last_import_segment : bool ,
747739 // This binding should be ignored during in-module resolution, so that we don't get
748740 // "self-confirming" import resolutions during import validation.
749741 unusable_binding : Option < & ' a NameBinding < ' a > > ,
@@ -754,7 +746,6 @@ impl<'a> Resolver<'a> {
754746 ns,
755747 parent_scope,
756748 finalize,
757- last_import_segment,
758749 unusable_binding,
759750 )
760751 . map_err ( |( determinacy, _) | determinacy)
@@ -768,7 +759,6 @@ impl<'a> Resolver<'a> {
768759 ns : Namespace ,
769760 parent_scope : & ParentScope < ' a > ,
770761 finalize : Option < Finalize > ,
771- last_import_segment : bool ,
772762 unusable_binding : Option < & ' a NameBinding < ' a > > ,
773763 ) -> Result < & ' a NameBinding < ' a > , ( Determinacy , Weak ) > {
774764 let tmp_parent_scope;
@@ -795,7 +785,6 @@ impl<'a> Resolver<'a> {
795785 adjusted_parent_scope,
796786 false ,
797787 finalize,
798- last_import_segment,
799788 unusable_binding,
800789 )
801790 }
@@ -808,7 +797,6 @@ impl<'a> Resolver<'a> {
808797 ns : Namespace ,
809798 parent_scope : & ParentScope < ' a > ,
810799 finalize : Option < Finalize > ,
811- last_import_segment : bool ,
812800 unusable_binding : Option < & ' a NameBinding < ' a > > ,
813801 ) -> Result < & ' a NameBinding < ' a > , Determinacy > {
814802 self . resolve_ident_in_module_unadjusted_ext (
@@ -818,7 +806,6 @@ impl<'a> Resolver<'a> {
818806 parent_scope,
819807 false ,
820808 finalize,
821- last_import_segment,
822809 unusable_binding,
823810 )
824811 . map_err ( |( determinacy, _) | determinacy)
@@ -835,7 +822,6 @@ impl<'a> Resolver<'a> {
835822 parent_scope : & ParentScope < ' a > ,
836823 restricted_shadowing : bool ,
837824 finalize : Option < Finalize > ,
838- last_import_segment : bool ,
839825 unusable_binding : Option < & ' a NameBinding < ' a > > ,
840826 ) -> Result < & ' a NameBinding < ' a > , ( Determinacy , Weak ) > {
841827 let module = match module {
@@ -848,7 +834,6 @@ impl<'a> Resolver<'a> {
848834 parent_scope,
849835 finalize,
850836 finalize. is_some ( ) ,
851- last_import_segment,
852837 unusable_binding,
853838 ) ;
854839 return binding. map_err ( |determinacy| ( determinacy, Weak :: No ) ) ;
@@ -889,7 +874,6 @@ impl<'a> Resolver<'a> {
889874 parent_scope,
890875 finalize,
891876 finalize. is_some ( ) ,
892- last_import_segment,
893877 unusable_binding,
894878 ) ;
895879 return binding. map_err ( |determinacy| ( determinacy, Weak :: No ) ) ;
@@ -900,7 +884,7 @@ impl<'a> Resolver<'a> {
900884 let resolution =
901885 self . resolution ( module, key) . try_borrow_mut ( ) . map_err ( |_| ( Determined , Weak :: No ) ) ?; // This happens when there is a cycle of imports.
902886
903- if let Some ( Finalize { path_span, .. } ) = finalize {
887+ if let Some ( Finalize { path_span, report_private , .. } ) = finalize {
904888 // If the primary binding is unusable, search further and return the shadowed glob
905889 // binding if it exists. What we really want here is having two separate scopes in
906890 // a module - one for non-globs and one for globs, but until that's done use this
@@ -921,14 +905,14 @@ impl<'a> Resolver<'a> {
921905 } ;
922906
923907 if !self . is_accessible_from ( binding. vis , parent_scope. module ) {
924- if last_import_segment {
925- return Err ( ( Determined , Weak :: No ) ) ;
926- } else {
908+ if report_private {
927909 self . privacy_errors . push ( PrivacyError {
928910 ident,
929911 binding,
930912 dedup_span : path_span,
931913 } ) ;
914+ } else {
915+ return Err ( ( Determined , Weak :: No ) ) ;
932916 }
933917 }
934918
@@ -995,7 +979,6 @@ impl<'a> Resolver<'a> {
995979 ns,
996980 & single_import. parent_scope ,
997981 None ,
998- last_import_segment,
999982 unusable_binding,
1000983 ) {
1001984 Err ( Determined ) => continue ,
@@ -1072,7 +1055,6 @@ impl<'a> Resolver<'a> {
10721055 ns,
10731056 adjusted_parent_scope,
10741057 None ,
1075- last_import_segment,
10761058 unusable_binding,
10771059 ) ;
10781060
@@ -1495,7 +1477,6 @@ impl<'a> Resolver<'a> {
14951477 ns,
14961478 parent_scope,
14971479 finalize,
1498- false ,
14991480 unusable_binding,
15001481 )
15011482 } else if let Some ( ribs) = ribs
@@ -1523,7 +1504,6 @@ impl<'a> Resolver<'a> {
15231504 parent_scope,
15241505 finalize,
15251506 finalize. is_some ( ) ,
1526- false ,
15271507 unusable_binding,
15281508 )
15291509 } ;
0 commit comments