diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-07-05 17:08:15 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-05 17:08:15 +0200 |
| commit | 720eb123af7badab651fda19dbbfb4716f56b6de (patch) | |
| tree | a2a011d60fb285ff6f33c87c3a587c285239e09c | |
| parent | 1c248ea22fdaf0c7f23d92cca00ebfb589f1d307 (diff) | |
| parent | c9e2aa4d7f9904046127c3f356a393b2532b887e (diff) | |
| download | rust-720eb123af7badab651fda19dbbfb4716f56b6de.tar.gz rust-720eb123af7badab651fda19dbbfb4716f56b6de.zip | |
Rollup merge of #98921 - TaKO8Ki:refactor-fulfillment-context-select, r=Dylan-DPC
Refactor: remove a redundant mutable variable
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/fulfill.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/fulfill.rs b/compiler/rustc_trait_selection/src/traits/fulfill.rs index d61166437d7..6663ff6bbe9 100644 --- a/compiler/rustc_trait_selection/src/traits/fulfill.rs +++ b/compiler/rustc_trait_selection/src/traits/fulfill.rs @@ -131,8 +131,6 @@ impl<'a, 'tcx> FulfillmentContext<'tcx> { let span = debug_span!("select", obligation_forest_size = ?self.predicates.len()); let _enter = span.enter(); - let mut errors = Vec::new(); - // Process pending obligations. let outcome: Outcome<_, _> = self.predicates.process_obligations(&mut FulfillProcessor { selcx, @@ -142,7 +140,8 @@ impl<'a, 'tcx> FulfillmentContext<'tcx> { // FIXME: if we kept the original cache key, we could mark projection // obligations as complete for the projection cache here. - errors.extend(outcome.errors.into_iter().map(to_fulfillment_error)); + let errors: Vec<FulfillmentError<'tcx>> = + outcome.errors.into_iter().map(to_fulfillment_error).collect(); debug!( "select({} predicates remaining, {} errors) done", @@ -728,7 +727,7 @@ impl<'a, 'b, 'tcx> FulfillProcessor<'a, 'b, 'tcx> { } return ProcessResult::Changed(vec![]); } else { - tracing::debug!("Does NOT hold: {:?}", obligation); + debug!("Does NOT hold: {:?}", obligation); } } |
