Reformat everything

This commit is contained in:
Deadbeef 2021-11-29 21:12:53 +08:00
parent fdf5322169
commit 8710a2e169
No known key found for this signature in database
GPG Key ID: 6D017A96D8E6C2F9
6 changed files with 11 additions and 20 deletions

View File

@ -47,10 +47,8 @@ pub trait TraitEngine<'tcx>: 'tcx {
fn select_all_or_error(&mut self, infcx: &InferCtxt<'_, 'tcx>) -> Vec<FulfillmentError<'tcx>>;
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 pending_obligations(&self) -> Vec<PredicateObligation<'tcx>>;

View File

@ -1256,7 +1256,10 @@ impl<'a, 'tcx> HashStable<StableHashingContext<'a>> 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(
self.caller_bounds().fold_with(folder)?,
self.reveal().fold_with(folder)?,

View File

@ -2144,10 +2144,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
previous_stack: TraitObligationStackList<'o, 'tcx>,
obligation: &'o TraitObligation<'tcx>,
) -> TraitObligationStack<'o, 'tcx> {
let fresh_trait_pred = obligation
.predicate
.fold_with(&mut self.freshener)
.into_ok();
let fresh_trait_pred = obligation.predicate.fold_with(&mut self.freshener).into_ok();
let dfn = previous_stack.cache.next_dfn();
let depth = previous_stack.depth() + 1;

View File

@ -1432,8 +1432,7 @@ pub fn check_type_bounds<'tcx>(
// Check that all obligations are satisfied by the implementation's
// version.
let errors =
inh.fulfillment_cx.borrow_mut().select_all_or_error(&infcx);
let errors = inh.fulfillment_cx.borrow_mut().select_all_or_error(&infcx);
if !errors.is_empty() {
infcx.report_fulfillment_errors(&errors, None, false);
return Err(ErrorReported);

View File

@ -610,10 +610,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
#[instrument(skip(self), level = "debug")]
pub(in super::super) fn select_all_obligations_or_error(&self) {
let errors = self
.fulfillment_cx
.borrow_mut()
.select_all_or_error(&self);
let errors = self.fulfillment_cx.borrow_mut().select_all_or_error(&self);
if !errors.is_empty() {
self.report_fulfillment_errors(&errors, self.inh.body_id, false);
@ -626,10 +623,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
fallback_has_occurred: bool,
mutate_fulfillment_errors: impl Fn(&mut Vec<traits::FulfillmentError<'tcx>>),
) {
let mut result = self
.fulfillment_cx
.borrow_mut()
.select_where_possible(self);
let mut result = self.fulfillment_cx.borrow_mut().select_where_possible(self);
if !result.is_empty() {
mutate_fulfillment_errors(&mut result);
self.report_fulfillment_errors(&result, self.inh.body_id, fallback_has_occurred);

View File

@ -28,4 +28,4 @@ impl const Baz for NonConstAdd {
type Qux = NonConstAdd; // OK
}
fn main() {}
fn main() {}