#[must_use]
for fns returning a list of errors
This commit is contained in:
parent
a19adefa0e
commit
cc82ccb145
4 changed files with 8 additions and 1 deletions
|
@ -75,6 +75,7 @@ impl<'tcx> InferCtxt<'tcx> {
|
||||||
/// result. After this, no more unification operations should be
|
/// result. After this, no more unification operations should be
|
||||||
/// done -- or the compiler will panic -- but it is legal to use
|
/// done -- or the compiler will panic -- but it is legal to use
|
||||||
/// `resolve_vars_if_possible` as well as `fully_resolve`.
|
/// `resolve_vars_if_possible` as well as `fully_resolve`.
|
||||||
|
#[must_use]
|
||||||
pub fn resolve_regions(
|
pub fn resolve_regions(
|
||||||
&self,
|
&self,
|
||||||
outlives_env: &OutlivesEnvironment<'tcx>,
|
outlives_env: &OutlivesEnvironment<'tcx>,
|
||||||
|
|
|
@ -36,6 +36,7 @@ pub trait TraitEngine<'tcx>: 'tcx {
|
||||||
obligation: PredicateObligation<'tcx>,
|
obligation: PredicateObligation<'tcx>,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
#[must_use]
|
||||||
fn select_where_possible(&mut self, infcx: &InferCtxt<'tcx>) -> Vec<FulfillmentError<'tcx>>;
|
fn select_where_possible(&mut self, infcx: &InferCtxt<'tcx>) -> Vec<FulfillmentError<'tcx>>;
|
||||||
|
|
||||||
fn collect_remaining_errors(&mut self) -> Vec<FulfillmentError<'tcx>>;
|
fn collect_remaining_errors(&mut self) -> Vec<FulfillmentError<'tcx>>;
|
||||||
|
@ -58,6 +59,7 @@ pub trait TraitEngineExt<'tcx> {
|
||||||
obligations: impl IntoIterator<Item = PredicateObligation<'tcx>>,
|
obligations: impl IntoIterator<Item = PredicateObligation<'tcx>>,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
#[must_use]
|
||||||
fn select_all_or_error(&mut self, infcx: &InferCtxt<'tcx>) -> Vec<FulfillmentError<'tcx>>;
|
fn select_all_or_error(&mut self, infcx: &InferCtxt<'tcx>) -> Vec<FulfillmentError<'tcx>>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -175,10 +175,12 @@ impl<'a, 'tcx> ObligationCtxt<'a, 'tcx> {
|
||||||
.map(|infer_ok| self.register_infer_ok_obligations(infer_ok))
|
.map(|infer_ok| self.register_infer_ok_obligations(infer_ok))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[must_use]
|
||||||
pub fn select_where_possible(&self) -> Vec<FulfillmentError<'tcx>> {
|
pub fn select_where_possible(&self) -> Vec<FulfillmentError<'tcx>> {
|
||||||
self.engine.borrow_mut().select_where_possible(self.infcx)
|
self.engine.borrow_mut().select_where_possible(self.infcx)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[must_use]
|
||||||
pub fn select_all_or_error(&self) -> Vec<FulfillmentError<'tcx>> {
|
pub fn select_all_or_error(&self) -> Vec<FulfillmentError<'tcx>> {
|
||||||
self.engine.borrow_mut().select_all_or_error(self.infcx)
|
self.engine.borrow_mut().select_all_or_error(self.infcx)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1763,7 +1763,9 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
|
||||||
|
|
||||||
// constrain inference variables a bit more to nested obligations from normalize so
|
// constrain inference variables a bit more to nested obligations from normalize so
|
||||||
// we can have more helpful errors.
|
// we can have more helpful errors.
|
||||||
ocx.select_where_possible();
|
//
|
||||||
|
// we intentionally errors from normalization here.
|
||||||
|
let _ = ocx.select_where_possible();
|
||||||
|
|
||||||
if let Err(new_err) = ocx.eq_exp(
|
if let Err(new_err) = ocx.eq_exp(
|
||||||
&obligation.cause,
|
&obligation.cause,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue