Auto merge of #94225 - matthiaskrgr:rollup-0728x8n, r=matthiaskrgr

Rollup of 10 pull requests

Successful merges:

 - #91192 (Some improvements to the async docs)
 - #94143 (rustc_const_eval: adopt let else in more places)
 - #94156 (Gracefully handle non-UTF-8 string slices when pretty printing)
 - #94186 (Update pin_static_ref stabilization version.)
 - #94189 (Implement LowerHex on Scalar to clean up their display in rustdoc)
 - #94190 (Use Metadata::modified instead of FileTime::from_last_modification_ti…)
 - #94203 (CTFE engine: Scalar: expose size-generic to_(u)int methods)
 - #94211 (Better error if the user tries to do assignment ... else)
 - #94215 (trait system: comments and small nonfunctional changes)
 - #94220 (Correctly handle miniz_oxide extern crate declaration)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
This commit is contained in:
bors 2022-02-21 22:53:45 +00:00
commit b8967b0d52
36 changed files with 260 additions and 244 deletions

View file

@ -160,20 +160,12 @@ fn overlap<'cx, 'tcx>(
);
selcx.infcx().probe_maybe_skip_leak_check(skip_leak_check.is_yes(), |snapshot| {
overlap_within_probe(
selcx,
skip_leak_check,
impl1_def_id,
impl2_def_id,
overlap_mode,
snapshot,
)
overlap_within_probe(selcx, impl1_def_id, impl2_def_id, overlap_mode, snapshot)
})
}
fn overlap_within_probe<'cx, 'tcx>(
selcx: &mut SelectionContext<'cx, 'tcx>,
skip_leak_check: SkipLeakCheck,
impl1_def_id: DefId,
impl2_def_id: DefId,
overlap_mode: OverlapMode,
@ -207,11 +199,11 @@ fn overlap_within_probe<'cx, 'tcx>(
}
}
if !skip_leak_check.is_yes() {
if infcx.leak_check(true, snapshot).is_err() {
debug!("overlap: leak check failed");
return None;
}
// We disable the leak when when creating the `snapshot` by using
// `infcx.probe_maybe_disable_leak_check`.
if infcx.leak_check(true, snapshot).is_err() {
debug!("overlap: leak check failed");
return None;
}
let intercrate_ambiguity_causes = selcx.take_intercrate_ambiguity_causes();

View file

@ -314,7 +314,7 @@ impl<'a, 'b, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'b, 'tcx> {
return ProcessResult::Unchanged;
}
self.progress_changed_obligations(pending_obligation)
self.process_changed_obligations(pending_obligation)
}
fn process_backedge<'c, I>(
@ -338,7 +338,7 @@ impl<'a, 'b, 'tcx> FulfillProcessor<'a, 'b, 'tcx> {
// actually uses this, so move this part of the code
// out of that loop.
#[inline(never)]
fn progress_changed_obligations(
fn process_changed_obligations(
&mut self,
pending_obligation: &mut PendingPredicateObligation<'tcx>,
) -> ProcessResult<PendingPredicateObligation<'tcx>, FulfillmentErrorCode<'tcx>> {

View file

@ -389,7 +389,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
for bound in matching_bounds {
// FIXME(oli-obk): it is suspicious that we are dropping the constness and
// polarity here.
let wc = self.evaluate_where_clause(stack, bound.map_bound(|t| t.trait_ref))?;
let wc = self.where_clause_may_apply(stack, bound.map_bound(|t| t.trait_ref))?;
if wc.may_apply() {
candidates.vec.push(ParamCandidate(bound));
}

View file

@ -1481,7 +1481,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
.map_err(|_| ())
}
fn evaluate_where_clause<'o>(
fn where_clause_may_apply<'o>(
&mut self,
stack: &TraitObligationStack<'o, 'tcx>,
where_clause_trait_ref: ty::PolyTraitRef<'tcx>,