summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_trait_selection/src/traits/outlives_bounds.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:57:31 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:57:31 +0000
commitdc0db358abe19481e475e10c32149b53370f1a1c (patch)
treeab8ce99c4b255ce46f99ef402c27916055b899ee /compiler/rustc_trait_selection/src/traits/outlives_bounds.rs
parentReleasing progress-linux version 1.71.1+dfsg1-2~progress7.99u1. (diff)
downloadrustc-dc0db358abe19481e475e10c32149b53370f1a1c.tar.xz
rustc-dc0db358abe19481e475e10c32149b53370f1a1c.zip
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'compiler/rustc_trait_selection/src/traits/outlives_bounds.rs')
-rw-r--r--compiler/rustc_trait_selection/src/traits/outlives_bounds.rs16
1 files changed, 6 insertions, 10 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/outlives_bounds.rs b/compiler/rustc_trait_selection/src/traits/outlives_bounds.rs
index f8d056e32..ae6fc7cf8 100644
--- a/compiler/rustc_trait_selection/src/traits/outlives_bounds.rs
+++ b/compiler/rustc_trait_selection/src/traits/outlives_bounds.rs
@@ -9,7 +9,7 @@ use rustc_span::def_id::LocalDefId;
pub use rustc_middle::traits::query::OutlivesBound;
-type Bounds<'a, 'tcx: 'a> = impl Iterator<Item = OutlivesBound<'tcx>> + 'a;
+pub type Bounds<'a, 'tcx: 'a> = impl Iterator<Item = OutlivesBound<'tcx>> + 'a;
pub trait InferCtxtExt<'a, 'tcx> {
fn implied_outlives_bounds(
&self,
@@ -57,16 +57,12 @@ impl<'a, 'tcx: 'a> InferCtxtExt<'a, 'tcx> for InferCtxt<'tcx> {
let ty = OpportunisticRegionResolver::new(self).fold_ty(ty);
// We do not expect existential variables in implied bounds.
- // We may however encounter unconstrained lifetime variables in invalid
- // code. See #110161 for context.
+ // We may however encounter unconstrained lifetime variables
+ // in very rare cases.
+ //
+ // See `ui/implied-bounds/implied-bounds-unconstrained-2.rs` for
+ // an example.
assert!(!ty.has_non_region_infer());
- if ty.has_infer() {
- self.tcx.sess.delay_span_bug(
- self.tcx.def_span(body_id),
- "skipped implied_outlives_bounds due to unconstrained lifetimes",
- );
- return vec![];
- }
let mut canonical_var_values = OriginalQueryValues::default();
let canonical_ty =