Skip to content

Commit 8c4ffaa

Browse files
committed
Inline loose_check fn on call site
1 parent 45983fe commit 8c4ffaa

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

compiler/rustc_trait_selection/src/traits/coherence.rs

+1-11
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ fn implicit_negative<'cx, 'tcx>(
287287
predicate: p,
288288
})
289289
.chain(obligations)
290-
.find(|o| loose_check(selcx, o));
290+
.find(|o| !selcx.predicate_may_hold_fatal(o));
291291

292292
if let Some(failing_obligation) = opt_failing_obligation {
293293
debug!("overlap: obligation unsatisfiable {:?}", failing_obligation);
@@ -363,16 +363,6 @@ fn negative_impl<'cx, 'tcx>(
363363
})
364364
}
365365

366-
fn loose_check<'cx, 'tcx>(
367-
selcx: &mut SelectionContext<'cx, 'tcx>,
368-
o: &PredicateObligation<'tcx>,
369-
) -> bool {
370-
// FIXME: the call to `selcx.predicate_may_hold_fatal` below should be ported
371-
// to the canonical trait query form, `infcx.predicate_may_hold`, once
372-
// the new system supports intercrate mode (which coherence needs).
373-
!selcx.predicate_may_hold_fatal(o)
374-
}
375-
376366
fn negative_impl_exists<'cx, 'tcx>(
377367
selcx: &SelectionContext<'cx, 'tcx>,
378368
param_env: ty::ParamEnv<'tcx>,

0 commit comments

Comments
 (0)