@@ -203,24 +203,6 @@ impl<'a> NameResolution<'a> {
203
203
204
204
self . binding . map ( Success )
205
205
}
206
-
207
- fn report_conflicts < F : FnMut ( & NameBinding , & NameBinding ) > ( & self , mut report : F ) {
208
- let binding = match self . binding {
209
- Some ( binding) => binding,
210
- None => return ,
211
- } ;
212
-
213
- for duplicate_glob in self . duplicate_globs . iter ( ) {
214
- // FIXME #31337: We currently allow items to shadow glob-imported re-exports.
215
- if !binding. is_import ( ) {
216
- if let NameBindingKind :: Import { binding, .. } = duplicate_glob. kind {
217
- if binding. is_import ( ) { continue }
218
- }
219
- }
220
-
221
- report ( duplicate_glob, binding) ;
222
- }
223
- }
224
206
}
225
207
226
208
impl < ' a > :: ModuleS < ' a > {
@@ -677,15 +659,23 @@ impl<'a, 'b:'a> ImportResolver<'a, 'b> {
677
659
let mut reexports = Vec :: new ( ) ;
678
660
for ( & ( name, ns) , resolution) in module. resolutions . borrow ( ) . iter ( ) {
679
661
let resolution = resolution. borrow ( ) ;
680
- resolution. report_conflicts ( |b1, b2| {
681
- self . report_conflict ( module, name, ns, b1, b2)
682
- } ) ;
683
-
684
662
let binding = match resolution. binding {
685
663
Some ( binding) => binding,
686
664
None => continue ,
687
665
} ;
688
666
667
+ // Report conflicts
668
+ for duplicate_glob in resolution. duplicate_globs . iter ( ) {
669
+ // FIXME #31337: We currently allow items to shadow glob-imported re-exports.
670
+ if !binding. is_import ( ) {
671
+ if let NameBindingKind :: Import { binding, .. } = duplicate_glob. kind {
672
+ if binding. is_import ( ) { continue }
673
+ }
674
+ }
675
+
676
+ self . report_conflict ( module, name, ns, duplicate_glob, binding) ;
677
+ }
678
+
689
679
if binding. vis == ty:: Visibility :: Public &&
690
680
( binding. is_import ( ) || binding. is_extern_crate ( ) ) {
691
681
if let Some ( def) = binding. def ( ) {
0 commit comments