]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_resolve/src/imports.rs
Rollup merge of #103329 - saethlin:nonnull-precondition, r=thomcc
[rust.git] / compiler / rustc_resolve / src / imports.rs
index 9e2234ae4a54fdae22fb1f419baff04603ecca6e..0a86374d76d5653d9375a30730a334069bc4d920 100644 (file)
@@ -252,7 +252,7 @@ pub(crate) fn try_define(
         self.set_binding_parent_module(binding, module);
         self.update_resolution(module, key, |this, resolution| {
             if let Some(old_binding) = resolution.binding {
-                if res == Res::Err {
+                if res == Res::Err && old_binding.res() != Res::Err {
                     // Do not override real bindings with `Res::Err`s from error recovery.
                     return Ok(());
                 }