Assert that obligations are empty before deeply normalizing
This commit is contained in:
@@ -60,6 +60,9 @@ pub fn compute_implied_outlives_bounds_inner<'tcx>(
|
||||
ty: Ty<'tcx>,
|
||||
) -> Result<Vec<OutlivesBound<'tcx>>, NoSolution> {
|
||||
let normalize_op = |ty| -> Result<_, NoSolution> {
|
||||
// We must normalize the type so we can compute the right outlives components.
|
||||
// for example, if we have some constrained param type like `T: Trait<Out = U>`,
|
||||
// and we know that `&'a T::Out` is WF, then we want to imply `U: 'a`.
|
||||
let ty = ocx
|
||||
.deeply_normalize(&ObligationCause::dummy(), param_env, ty)
|
||||
.map_err(|_| NoSolution)?;
|
||||
|
||||
Reference in New Issue
Block a user