about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-08-31 22:15:26 +0000
committerbors <bors@rust-lang.org>2021-08-31 22:15:26 +0000
commita3956106d12cebec91be0637759e29ab6908b4cd (patch)
tree857e77c465d3c213c7074668d72d951d35b8c6b3
parent29ef6cf1637aa8317f8911f93f14e18d404c1b0e (diff)
parent43738c678799f1cf41b54de4ce169a5dde39d30f (diff)
downloadrust-a3956106d12cebec91be0637759e29ab6908b4cd.tar.gz
rust-a3956106d12cebec91be0637759e29ab6908b4cd.zip
Auto merge of #88533 - oli-obk:tait_🧊, r=spastorino
Concrete regions can show up in mir borrowck if the originated from there

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. Instead mir borrock does all the logic, and it can handle concrete regions just fine, as long as it created them itself.

fixes #83190 which was introduced by #87287

r? `@spastorino`
-rw-r--r--compiler/rustc_mir/src/borrow_check/region_infer/opaque_types.rs10
1 files changed, 1 insertions, 9 deletions
diff --git a/compiler/rustc_mir/src/borrow_check/region_infer/opaque_types.rs b/compiler/rustc_mir/src/borrow_check/region_infer/opaque_types.rs
index e9ab62e1664..12fceeff088 100644
--- a/compiler/rustc_mir/src/borrow_check/region_infer/opaque_types.rs
+++ b/compiler/rustc_mir/src/borrow_check/region_infer/opaque_types.rs
@@ -82,15 +82,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
                             .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);