Skip to content

Commit 91f63cb

Browse files
committed
make sure to not normalize impl header in coherence
1 parent 6a6ebb9 commit 91f63cb

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

compiler/rustc_trait_selection/src/traits/coherence.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,16 @@ fn overlap<'tcx>(
278278
// empty environment.
279279
let param_env = ty::ParamEnv::empty();
280280

281-
let impl1_header =
282-
fresh_impl_header_normalized(selcx.infcx, param_env, impl1_def_id, is_of_trait);
283-
let impl2_header =
284-
fresh_impl_header_normalized(selcx.infcx, param_env, impl2_def_id, is_of_trait);
281+
let impl1_header = if tcx.next_trait_solver_in_coherence() {
282+
fresh_impl_header(selcx.infcx, impl1_def_id, is_of_trait)
283+
} else {
284+
fresh_impl_header_normalized(selcx.infcx, param_env, impl1_def_id, is_of_trait)
285+
};
286+
let impl2_header = if tcx.next_trait_solver_in_coherence() {
287+
fresh_impl_header(selcx.infcx, impl2_def_id, is_of_trait)
288+
} else {
289+
fresh_impl_header_normalized(selcx.infcx, param_env, impl2_def_id, is_of_trait)
290+
};
285291

286292
// Equate the headers to find their intersection (the general type, with infer vars,
287293
// that may apply both impls).

0 commit comments

Comments
 (0)