Rollup merge of #152711 - petrochenkov:globass, r=Kivooeo
resolve: Disable an assert that no longer holds Fixes https://github.com/rust-lang/rust/issues/152606 Fixes https://github.com/rust-lang/rust/issues/152595
This commit is contained in:
commit
8f3bbc1f5a
2 changed files with 18 additions and 1 deletions
|
|
@ -371,6 +371,8 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
|
|||
// - A glob decl is overwritten by its clone after setting ambiguity in it.
|
||||
// FIXME: avoid this by removing `warn_ambiguity`, or by triggering glob re-fetch
|
||||
// with the same decl in some way.
|
||||
// - A glob decl is overwritten by a glob decl with larger visibility.
|
||||
// FIXME: avoid this by updating this visibility in place.
|
||||
// - A glob decl is overwritten by a glob decl re-fetching an
|
||||
// overwritten decl from other module (the recursive case).
|
||||
// Here we are detecting all such re-fetches and overwrite old decls
|
||||
|
|
@ -384,7 +386,8 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
|
|||
// FIXME: reenable the asserts when `warn_ambiguity` is removed (#149195).
|
||||
// assert_ne!(old_deep_decl, deep_decl);
|
||||
// assert!(old_deep_decl.is_glob_import());
|
||||
assert!(!deep_decl.is_glob_import());
|
||||
// FIXME: reenable the assert when visibility is updated in place.
|
||||
// assert!(!deep_decl.is_glob_import());
|
||||
if old_glob_decl.ambiguity.get().is_some() && glob_decl.ambiguity.get().is_none() {
|
||||
// Do not lose glob ambiguities when re-fetching the glob.
|
||||
glob_decl.ambiguity.set_unchecked(old_glob_decl.ambiguity.get());
|
||||
|
|
|
|||
14
tests/ui/imports/overwrite-different-vis-3.rs
Normal file
14
tests/ui/imports/overwrite-different-vis-3.rs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
// Regression test for issue #152606.
|
||||
|
||||
//@ check-pass
|
||||
|
||||
mod outer {
|
||||
mod inner {
|
||||
use super::*; // should go before the ambiguous glob imports
|
||||
}
|
||||
|
||||
use crate::*;
|
||||
pub use crate::*;
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue