File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -264,7 +264,18 @@ fn impl_trait_ref_has_enough_non_local_candidates<'tcx>(
264
264
binder : EarlyBinder < TraitRef < ' tcx > > ,
265
265
mut did_has_local_parent : impl FnMut ( DefId ) -> bool ,
266
266
) -> bool {
267
- let infcx = tcx. infer_ctxt ( ) . build ( ) ;
267
+ let infcx = tcx
268
+ . infer_ctxt ( )
269
+ // We use the new trait solver since the obligation we are trying to
270
+ // prove here may overflow and those are fatal in the old trait solver.
271
+ //
272
+ // Which is unacceptable. Thanksfully the part we use here are very
273
+ // similar to the new-trait-solver-as-coherence, which is in stabilization.
274
+ //
275
+ // https://github.com/rust-lang/rust/issues/123573
276
+ . with_next_trait_solver ( true )
277
+ . build ( ) ;
278
+
268
279
let trait_ref = binder. instantiate ( tcx, infcx. fresh_args_for_item ( infer_span, trait_def_id) ) ;
269
280
270
281
let trait_ref = trait_ref. fold_with ( & mut ReplaceLocalTypesWithInfer {
You can’t perform that action at this time.
0 commit comments