Reformat everything
This commit is contained in:
parent
fdf5322169
commit
8710a2e169
6 changed files with 11 additions and 20 deletions
|
@ -47,10 +47,8 @@ pub trait TraitEngine<'tcx>: 'tcx {
|
||||||
|
|
||||||
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>>;
|
||||||
|
|
||||||
fn select_where_possible(
|
fn select_where_possible(&mut self, infcx: &InferCtxt<'_, 'tcx>)
|
||||||
&mut self,
|
-> Vec<FulfillmentError<'tcx>>;
|
||||||
infcx: &InferCtxt<'_, 'tcx>,
|
|
||||||
) -> Vec<FulfillmentError<'tcx>>;
|
|
||||||
|
|
||||||
fn pending_obligations(&self) -> Vec<PredicateObligation<'tcx>>;
|
fn pending_obligations(&self) -> Vec<PredicateObligation<'tcx>>;
|
||||||
|
|
||||||
|
|
|
@ -1256,7 +1256,10 @@ impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for ParamEnv<'tcx> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'tcx> TypeFoldable<'tcx> for ParamEnv<'tcx> {
|
impl<'tcx> TypeFoldable<'tcx> for ParamEnv<'tcx> {
|
||||||
fn super_fold_with<F: ty::fold::TypeFolder<'tcx>>(self, folder: &mut F) -> Result<Self, F::Error> {
|
fn super_fold_with<F: ty::fold::TypeFolder<'tcx>>(
|
||||||
|
self,
|
||||||
|
folder: &mut F,
|
||||||
|
) -> Result<Self, F::Error> {
|
||||||
Ok(ParamEnv::new(
|
Ok(ParamEnv::new(
|
||||||
self.caller_bounds().fold_with(folder)?,
|
self.caller_bounds().fold_with(folder)?,
|
||||||
self.reveal().fold_with(folder)?,
|
self.reveal().fold_with(folder)?,
|
||||||
|
|
|
@ -2144,10 +2144,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
||||||
previous_stack: TraitObligationStackList<'o, 'tcx>,
|
previous_stack: TraitObligationStackList<'o, 'tcx>,
|
||||||
obligation: &'o TraitObligation<'tcx>,
|
obligation: &'o TraitObligation<'tcx>,
|
||||||
) -> TraitObligationStack<'o, 'tcx> {
|
) -> TraitObligationStack<'o, 'tcx> {
|
||||||
let fresh_trait_pred = obligation
|
let fresh_trait_pred = obligation.predicate.fold_with(&mut self.freshener).into_ok();
|
||||||
.predicate
|
|
||||||
.fold_with(&mut self.freshener)
|
|
||||||
.into_ok();
|
|
||||||
|
|
||||||
let dfn = previous_stack.cache.next_dfn();
|
let dfn = previous_stack.cache.next_dfn();
|
||||||
let depth = previous_stack.depth() + 1;
|
let depth = previous_stack.depth() + 1;
|
||||||
|
|
|
@ -1432,8 +1432,7 @@ pub fn check_type_bounds<'tcx>(
|
||||||
|
|
||||||
// Check that all obligations are satisfied by the implementation's
|
// Check that all obligations are satisfied by the implementation's
|
||||||
// version.
|
// version.
|
||||||
let errors =
|
let errors = inh.fulfillment_cx.borrow_mut().select_all_or_error(&infcx);
|
||||||
inh.fulfillment_cx.borrow_mut().select_all_or_error(&infcx);
|
|
||||||
if !errors.is_empty() {
|
if !errors.is_empty() {
|
||||||
infcx.report_fulfillment_errors(&errors, None, false);
|
infcx.report_fulfillment_errors(&errors, None, false);
|
||||||
return Err(ErrorReported);
|
return Err(ErrorReported);
|
||||||
|
|
|
@ -610,10 +610,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||||
|
|
||||||
#[instrument(skip(self), level = "debug")]
|
#[instrument(skip(self), level = "debug")]
|
||||||
pub(in super::super) fn select_all_obligations_or_error(&self) {
|
pub(in super::super) fn select_all_obligations_or_error(&self) {
|
||||||
let errors = self
|
let errors = self.fulfillment_cx.borrow_mut().select_all_or_error(&self);
|
||||||
.fulfillment_cx
|
|
||||||
.borrow_mut()
|
|
||||||
.select_all_or_error(&self);
|
|
||||||
|
|
||||||
if !errors.is_empty() {
|
if !errors.is_empty() {
|
||||||
self.report_fulfillment_errors(&errors, self.inh.body_id, false);
|
self.report_fulfillment_errors(&errors, self.inh.body_id, false);
|
||||||
|
@ -626,10 +623,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||||
fallback_has_occurred: bool,
|
fallback_has_occurred: bool,
|
||||||
mutate_fulfillment_errors: impl Fn(&mut Vec<traits::FulfillmentError<'tcx>>),
|
mutate_fulfillment_errors: impl Fn(&mut Vec<traits::FulfillmentError<'tcx>>),
|
||||||
) {
|
) {
|
||||||
let mut result = self
|
let mut result = self.fulfillment_cx.borrow_mut().select_where_possible(self);
|
||||||
.fulfillment_cx
|
|
||||||
.borrow_mut()
|
|
||||||
.select_where_possible(self);
|
|
||||||
if !result.is_empty() {
|
if !result.is_empty() {
|
||||||
mutate_fulfillment_errors(&mut result);
|
mutate_fulfillment_errors(&mut result);
|
||||||
self.report_fulfillment_errors(&result, self.inh.body_id, fallback_has_occurred);
|
self.report_fulfillment_errors(&result, self.inh.body_id, fallback_has_occurred);
|
||||||
|
|
|
@ -28,4 +28,4 @@ impl const Baz for NonConstAdd {
|
||||||
type Qux = NonConstAdd; // OK
|
type Qux = NonConstAdd; // OK
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue