Only add_implied_bounds for norm_ty if different
This commit is contained in:
parent
c49b0762c0
commit
8e7613f9e0
1 changed files with 4 additions and 3 deletions
|
@ -259,7 +259,7 @@ impl UniversalRegionRelationsBuilder<'cx, 'tcx> {
|
||||||
// We add implied bounds from both the unnormalized and normalized ty
|
// We add implied bounds from both the unnormalized and normalized ty
|
||||||
// See issue #87748
|
// See issue #87748
|
||||||
let constraints_implied_1 = self.add_implied_bounds(ty);
|
let constraints_implied_1 = self.add_implied_bounds(ty);
|
||||||
let TypeOpOutput { output: ty, constraints: constraints1, .. } = self
|
let TypeOpOutput { output: norm_ty, constraints: constraints1, .. } = self
|
||||||
.param_env
|
.param_env
|
||||||
.and(type_op::normalize::Normalize::new(ty))
|
.and(type_op::normalize::Normalize::new(ty))
|
||||||
.fully_perform(self.infcx)
|
.fully_perform(self.infcx)
|
||||||
|
@ -286,8 +286,9 @@ impl UniversalRegionRelationsBuilder<'cx, 'tcx> {
|
||||||
// }
|
// }
|
||||||
// ```
|
// ```
|
||||||
// Both &Self::Bar and &() are WF
|
// Both &Self::Bar and &() are WF
|
||||||
let constraints_implied_2 = self.add_implied_bounds(ty);
|
let constraints_implied_2 =
|
||||||
normalized_inputs_and_output.push(ty);
|
if ty != norm_ty { self.add_implied_bounds(norm_ty) } else { None };
|
||||||
|
normalized_inputs_and_output.push(norm_ty);
|
||||||
constraints1.into_iter().chain(constraints_implied_1).chain(constraints_implied_2)
|
constraints1.into_iter().chain(constraints_implied_1).chain(constraints_implied_2)
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue