Skip to content

Commit 052b31b

Browse files
committed
Move auxiliary fns out of overlap_with_probe
1 parent f518827 commit 052b31b

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

compiler/rustc_trait_selection/src/traits/coherence.rs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -157,25 +157,6 @@ fn overlap_within_probe<'cx, 'tcx>(
157157
impl2_def_id: DefId,
158158
snapshot: &CombinedSnapshot<'_, 'tcx>,
159159
) -> Option<OverlapResult<'tcx>> {
160-
fn loose_check<'cx, 'tcx>(
161-
selcx: &mut SelectionContext<'cx, 'tcx>,
162-
o: &PredicateObligation<'tcx>,
163-
) -> bool {
164-
!selcx.predicate_may_hold_fatal(o)
165-
}
166-
167-
fn strict_check<'cx, 'tcx>(
168-
selcx: &SelectionContext<'cx, 'tcx>,
169-
o: &PredicateObligation<'tcx>,
170-
) -> bool {
171-
let infcx = selcx.infcx();
172-
let tcx = infcx.tcx;
173-
o.flip_polarity(tcx)
174-
.as_ref()
175-
.map(|o| selcx.infcx().predicate_must_hold_modulo_regions(o))
176-
.unwrap_or(false)
177-
}
178-
179160
// For the purposes of this check, we don't bring any placeholder
180161
// types into scope; instead, we replace the generic types with
181162
// fresh type variables, and hence we do our evaluations in an
@@ -275,6 +256,25 @@ fn overlap_within_probe<'cx, 'tcx>(
275256
Some(OverlapResult { impl_header, intercrate_ambiguity_causes, involves_placeholder })
276257
}
277258

259+
fn loose_check<'cx, 'tcx>(
260+
selcx: &mut SelectionContext<'cx, 'tcx>,
261+
o: &PredicateObligation<'tcx>,
262+
) -> bool {
263+
!selcx.predicate_may_hold_fatal(o)
264+
}
265+
266+
fn strict_check<'cx, 'tcx>(
267+
selcx: &SelectionContext<'cx, 'tcx>,
268+
o: &PredicateObligation<'tcx>,
269+
) -> bool {
270+
let infcx = selcx.infcx();
271+
let tcx = infcx.tcx;
272+
o.flip_polarity(tcx)
273+
.as_ref()
274+
.map(|o| selcx.infcx().predicate_must_hold_modulo_regions(o))
275+
.unwrap_or(false)
276+
}
277+
278278
pub fn trait_ref_is_knowable<'tcx>(
279279
tcx: TyCtxt<'tcx>,
280280
trait_ref: ty::TraitRef<'tcx>,

0 commit comments

Comments
 (0)