Skip to content

Commit d863021

Browse files
committed
fmt
1 parent f1126f1 commit d863021

File tree

8 files changed

+18
-42
lines changed

8 files changed

+18
-42
lines changed

compiler/rustc_infer/src/traits/engine.rs

+3-8
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,7 @@ pub trait TraitEngine<'tcx>: 'tcx {
4646
obligation: PredicateObligation<'tcx>,
4747
);
4848

49-
fn select_all_or_error(
50-
&mut self,
51-
infcx: &InferCtxt<'_, 'tcx>,
52-
) -> Vec<FulfillmentError<'tcx>>;
49+
fn select_all_or_error(&mut self, infcx: &InferCtxt<'_, 'tcx>) -> Vec<FulfillmentError<'tcx>>;
5350

5451
fn select_all_with_constness_or_error(
5552
&mut self,
@@ -59,10 +56,8 @@ pub trait TraitEngine<'tcx>: 'tcx {
5956
self.select_all_or_error(infcx)
6057
}
6158

62-
fn select_where_possible(
63-
&mut self,
64-
infcx: &InferCtxt<'_, 'tcx>,
65-
) -> Vec<FulfillmentError<'tcx>>;
59+
fn select_where_possible(&mut self, infcx: &InferCtxt<'_, 'tcx>)
60+
-> Vec<FulfillmentError<'tcx>>;
6661

6762
// FIXME(fee1-dead) this should not provide a default body for chalk as chalk should be updated
6863
fn select_with_constness_where_possible(

compiler/rustc_trait_selection/src/traits/auto_trait.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ impl<'tcx> AutoTraitFinder<'tcx> {
188188
let mut fulfill = FulfillmentContext::new();
189189
fulfill.register_bound(&infcx, full_env, ty, trait_did, ObligationCause::dummy());
190190
let errors = fulfill.select_all_or_error(&infcx);
191-
191+
192192
if !errors.is_empty() {
193193
panic!("Unable to fulfill trait {:?} for '{:?}': {:?}", trait_did, ty, errors);
194194
}

compiler/rustc_trait_selection/src/traits/chalk_fulfill.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,7 @@ impl TraitEngine<'tcx> for FulfillmentContext<'tcx> {
4949
self.obligations.insert(obligation);
5050
}
5151

52-
fn select_all_or_error(
53-
&mut self,
54-
infcx: &InferCtxt<'_, 'tcx>,
55-
) -> Vec<FulfillmentError<'tcx>> {
52+
fn select_all_or_error(&mut self, infcx: &InferCtxt<'_, 'tcx>) -> Vec<FulfillmentError<'tcx>> {
5653
{
5754
let errors = self.select_where_possible(infcx);
5855

@@ -62,8 +59,7 @@ impl TraitEngine<'tcx> for FulfillmentContext<'tcx> {
6259
}
6360

6461
// any remaining obligations are errors
65-
self
66-
.obligations
62+
self.obligations
6763
.iter()
6864
.map(|obligation| FulfillmentError {
6965
obligation: obligation.clone(),

compiler/rustc_trait_selection/src/traits/fulfill.rs

+4-20
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,7 @@ impl<'a, 'tcx> FulfillmentContext<'tcx> {
126126
}
127127

128128
/// Attempts to select obligations using `selcx`.
129-
fn select(
130-
&mut self,
131-
selcx: &mut SelectionContext<'a, 'tcx>,
132-
) -> Vec<FulfillmentError<'tcx>> {
129+
fn select(&mut self, selcx: &mut SelectionContext<'a, 'tcx>) -> Vec<FulfillmentError<'tcx>> {
133130
let span = debug_span!("select", obligation_forest_size = ?self.predicates.len());
134131
let _enter = span.enter();
135132

@@ -223,23 +220,15 @@ impl<'tcx> TraitEngine<'tcx> for FulfillmentContext<'tcx> {
223220
.register_obligation(PendingPredicateObligation { obligation, stalled_on: vec![] });
224221
}
225222

226-
fn select_all_or_error(
227-
&mut self,
228-
infcx: &InferCtxt<'_, 'tcx>,
229-
) -> Vec<FulfillmentError<'tcx>> {
223+
fn select_all_or_error(&mut self, infcx: &InferCtxt<'_, 'tcx>) -> Vec<FulfillmentError<'tcx>> {
230224
{
231225
let errors = self.select_where_possible(infcx);
232226
if !errors.is_empty() {
233227
return errors;
234228
}
235229
}
236230

237-
self
238-
.predicates
239-
.to_errors(CodeAmbiguity)
240-
.into_iter()
241-
.map(to_fulfillment_error)
242-
.collect()
231+
self.predicates.to_errors(CodeAmbiguity).into_iter().map(to_fulfillment_error).collect()
243232
}
244233

245234
fn select_all_with_constness_or_error(
@@ -254,12 +243,7 @@ impl<'tcx> TraitEngine<'tcx> for FulfillmentContext<'tcx> {
254243
}
255244
}
256245

257-
self
258-
.predicates
259-
.to_errors(CodeAmbiguity)
260-
.into_iter()
261-
.map(to_fulfillment_error)
262-
.collect()
246+
self.predicates.to_errors(CodeAmbiguity).into_iter().map(to_fulfillment_error).collect()
263247
}
264248

265249
fn select_where_possible(

compiler/rustc_trait_selection/src/traits/query/type_op/custom.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ fn scrape_region_constraints<'tcx, Op: super::TypeOp<'tcx, Output = R>, R>(
7878
debug_assert!(obligations.iter().all(|o| o.cause.body_id == dummy_body_id));
7979
fulfill_cx.register_predicate_obligations(infcx, obligations);
8080
let errors = fulfill_cx.select_all_or_error(infcx);
81-
if !errors.is_empty() {
81+
if !errors.is_empty() {
8282
infcx.tcx.sess.diagnostic().delay_span_bug(
8383
DUMMY_SP,
8484
&format!("errors selecting obligation during MIR typeck: {:?}", errors),

compiler/rustc_typeck/src/check/check.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ fn check_opaque_meets_bounds<'tcx>(
664664
// Check that all obligations are satisfied by the implementation's
665665
// version.
666666
let errors = inh.fulfillment_cx.borrow_mut().select_all_or_error(&infcx);
667-
if !errors.is_empty() {
667+
if !errors.is_empty() {
668668
infcx.report_fulfillment_errors(&errors, None, false);
669669
}
670670

compiler/rustc_typeck/src/check/compare_method.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1096,7 +1096,7 @@ crate fn compare_const_impl<'tcx>(
10961096
// Check that all obligations are satisfied by the implementation's
10971097
// version.
10981098
let errors = inh.fulfillment_cx.borrow_mut().select_all_or_error(&infcx);
1099-
if !errors.is_empty() {
1099+
if !errors.is_empty() {
11001100
infcx.report_fulfillment_errors(&errors, None, false);
11011101
return;
11021102
}
@@ -1213,7 +1213,7 @@ fn compare_type_predicate_entailment<'tcx>(
12131213
// Check that all obligations are satisfied by the implementation's
12141214
// version.
12151215
let errors = inh.fulfillment_cx.borrow_mut().select_all_or_error(&infcx);
1216-
if !errors.is_empty() {
1216+
if !errors.is_empty() {
12171217
infcx.report_fulfillment_errors(&errors, None, false);
12181218
return Err(ErrorReported);
12191219
}
@@ -1430,7 +1430,8 @@ pub fn check_type_bounds<'tcx>(
14301430

14311431
// Check that all obligations are satisfied by the implementation's
14321432
// version.
1433-
let errors = inh.fulfillment_cx.borrow_mut().select_all_with_constness_or_error(&infcx, constness);
1433+
let errors =
1434+
inh.fulfillment_cx.borrow_mut().select_all_with_constness_or_error(&infcx, constness);
14341435
if !errors.is_empty() {
14351436
infcx.report_fulfillment_errors(&errors, None, false);
14361437
return Err(ErrorReported);

compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
642642

643643
#[instrument(skip(self), level = "debug")]
644644
pub(in super::super) fn select_all_obligations_or_error(&self) {
645-
let errors =self
645+
let errors = self
646646
.fulfillment_cx
647647
.borrow_mut()
648648
.select_all_with_constness_or_error(&self, self.inh.constness);
@@ -662,7 +662,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
662662
.fulfillment_cx
663663
.borrow_mut()
664664
.select_with_constness_where_possible(self, self.inh.constness);
665-
if !result.is_empty() {
665+
if !result.is_empty() {
666666
mutate_fulfillment_errors(&mut result);
667667
self.report_fulfillment_errors(&result, self.inh.body_id, fallback_has_occurred);
668668
}

0 commit comments

Comments
 (0)