diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2021-09-26 19:29:53 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2021-10-02 18:31:50 +0300 |
| commit | ded08e44c65ebabc0bcc45bba8ec88143d6be93c (patch) | |
| tree | a20cc0cae9e78466ff42f97c807d9474fb157a06 /compiler/rustc_resolve/src/diagnostics.rs | |
| parent | 5aa732a364651010de8f8c5c7bada11e1da7fce1 (diff) | |
| download | rust-ded08e44c65ebabc0bcc45bba8ec88143d6be93c.tar.gz rust-ded08e44c65ebabc0bcc45bba8ec88143d6be93c.zip | |
resolve: Avoid comparing modules by optional def-id
It makes all block modules identical during comparison
Diffstat (limited to 'compiler/rustc_resolve/src/diagnostics.rs')
| -rw-r--r-- | compiler/rustc_resolve/src/diagnostics.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_resolve/src/diagnostics.rs b/compiler/rustc_resolve/src/diagnostics.rs index ab1f47c81db..dea47c25a8e 100644 --- a/compiler/rustc_resolve/src/diagnostics.rs +++ b/compiler/rustc_resolve/src/diagnostics.rs @@ -801,7 +801,7 @@ impl<'a> Resolver<'a> { None => worklist_via_import.pop(), Some(x) => Some(x), } { - let in_module_is_extern = !in_module.def_id().unwrap().is_local(); + let in_module_is_extern = !in_module.def_id().is_local(); // We have to visit module children in deterministic order to avoid // instabilities in reported imports (#43552). in_module.for_each_child(self, |this, ident, ns, name_binding| { @@ -884,7 +884,7 @@ impl<'a> Resolver<'a> { if !is_extern_crate_that_also_appears_in_prelude { // add the module to the lookup - if seen_modules.insert(module.def_id().unwrap()) { + if seen_modules.insert(module.def_id()) { if via_import { &mut worklist_via_import } else { &mut worklist } .push((module, path_segments, child_accessible)); } |
