]> git.lizzy.rs Git - rust.git/commitdiff
Concrete regions can show up in mir borrowck if the originated from there.
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Tue, 31 Aug 2021 14:38:21 +0000 (14:38 +0000)
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Tue, 31 Aug 2021 14:38:21 +0000 (14:38 +0000)
We used to not encounter them here, because we took regions from typeck's opaque type resolution by renumbering them. We don't do that anymore.

compiler/rustc_mir/src/borrow_check/region_infer/opaque_types.rs

index e9ab62e1664f972778fa884a8b46a9f53f6f62cd..12fceeff0884c92a8f4f8ada963004d36b86c8f8 100644 (file)
@@ -82,15 +82,7 @@ pub(in crate::borrow_check) fn infer_opaque_types(
                             .find(|ur_vid| self.eval_equal(vid, **ur_vid))
                             .and_then(|ur_vid| self.definitions[*ur_vid].external_name)
                             .unwrap_or(infcx.tcx.lifetimes.re_root_empty),
-                        ty::ReLateBound(..) => region,
-                        ty::ReStatic => region,
-                        _ => {
-                            infcx.tcx.sess.delay_span_bug(
-                                span,
-                                &format!("unexpected concrete region in borrowck: {:?}", region),
-                            );
-                            region
-                        }
+                        _ => region,
                     });
 
                 debug!(?universal_concrete_type, ?universal_substs);