Skip to content

Commit 675afc4

Browse files
petrochenkovcuviper
authored andcommitted
resolve: Disable an assert that no longer holds
(cherry picked from commit b541f1b)
1 parent fe9b522 commit 675afc4

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

compiler/rustc_resolve/src/imports.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,8 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
366366
// - A glob decl is overwritten by its clone after setting ambiguity in it.
367367
// FIXME: avoid this by removing `warn_ambiguity`, or by triggering glob re-fetch
368368
// with the same decl in some way.
369+
// - A glob decl is overwritten by a glob decl with larger visibility.
370+
// FIXME: avoid this by updating this visibility in place.
369371
// - A glob decl is overwritten by a glob decl re-fetching an
370372
// overwritten decl from other module (the recursive case).
371373
// Here we are detecting all such re-fetches and overwrite old decls
@@ -379,7 +381,8 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
379381
// FIXME: reenable the asserts when `warn_ambiguity` is removed (#149195).
380382
// assert_ne!(old_deep_decl, deep_decl);
381383
// assert!(old_deep_decl.is_glob_import());
382-
assert!(!deep_decl.is_glob_import());
384+
// FIXME: reenable the assert when visibility is updated in place.
385+
// assert!(!deep_decl.is_glob_import());
383386
if old_glob_decl.ambiguity.get().is_some() && glob_decl.ambiguity.get().is_none() {
384387
// Do not lose glob ambiguities when re-fetching the glob.
385388
glob_decl.ambiguity.set_unchecked(old_glob_decl.ambiguity.get());
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Regression test for issue #152606.
2+
3+
//@ check-pass
4+
5+
mod outer {
6+
mod inner {
7+
use super::*; // should go before the ambiguous glob imports
8+
}
9+
10+
use crate::*;
11+
pub use crate::*;
12+
}
13+
14+
fn main() {}

0 commit comments

Comments
 (0)