diff options
| author | Santiago Pastorino <spastorino@gmail.com> | 2022-02-10 16:39:52 -0300 |
|---|---|---|
| committer | Santiago Pastorino <spastorino@gmail.com> | 2022-02-14 12:57:22 -0300 |
| commit | 8c4ffaaa7c3c36249f4f9a26a78e889cf4a831ef (patch) | |
| tree | f319130bff6be1bafb56ab8597c2f4fc9422db49 | |
| parent | 45983fecff0d4bf66e80c1299697b591757a81c0 (diff) | |
| download | rust-8c4ffaaa7c3c36249f4f9a26a78e889cf4a831ef.tar.gz rust-8c4ffaaa7c3c36249f4f9a26a78e889cf4a831ef.zip | |
Inline loose_check fn on call site
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/coherence.rs | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/coherence.rs b/compiler/rustc_trait_selection/src/traits/coherence.rs index 9d690578cfc..ed55da623cb 100644 --- a/compiler/rustc_trait_selection/src/traits/coherence.rs +++ b/compiler/rustc_trait_selection/src/traits/coherence.rs @@ -287,7 +287,7 @@ fn implicit_negative<'cx, 'tcx>( predicate: p, }) .chain(obligations) - .find(|o| loose_check(selcx, o)); + .find(|o| !selcx.predicate_may_hold_fatal(o)); if let Some(failing_obligation) = opt_failing_obligation { debug!("overlap: obligation unsatisfiable {:?}", failing_obligation); @@ -363,16 +363,6 @@ fn negative_impl<'cx, 'tcx>( }) } -fn loose_check<'cx, 'tcx>( - selcx: &mut SelectionContext<'cx, 'tcx>, - o: &PredicateObligation<'tcx>, -) -> bool { - // FIXME: the call to `selcx.predicate_may_hold_fatal` below should be ported - // to the canonical trait query form, `infcx.predicate_may_hold`, once - // the new system supports intercrate mode (which coherence needs). - !selcx.predicate_may_hold_fatal(o) -} - fn negative_impl_exists<'cx, 'tcx>( selcx: &SelectionContext<'cx, 'tcx>, param_env: ty::ParamEnv<'tcx>, |
