Skip to content

Commit 2a373d7

Browse files
Make it clearer that the only infers we expect to see when processing outlives are regions
1 parent f364674 commit 2a373d7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

compiler/rustc_infer/src/infer/outlives/obligations.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,13 @@ where
363363
return;
364364
}
365365

366+
if alias_ty.has_non_region_infer() {
367+
self.tcx
368+
.dcx()
369+
.span_delayed_bug(origin.span(), "an alias has infers during region solving");
370+
return;
371+
}
372+
366373
// This case is thorny for inference. The fundamental problem is
367374
// that there are many cases where we have choice, and inference
368375
// doesn't like choice (the current region inference in
@@ -408,7 +415,7 @@ where
408415
let is_opaque = alias_ty.kind(self.tcx) == ty::Opaque;
409416
if approx_env_bounds.is_empty()
410417
&& trait_bounds.is_empty()
411-
&& (alias_ty.has_infer() || is_opaque)
418+
&& (alias_ty.has_infer_regions() || is_opaque)
412419
{
413420
debug!("no declared bounds");
414421
let opt_variances = is_opaque.then(|| self.tcx.variances_of(alias_ty.def_id));

0 commit comments

Comments
 (0)