Skip to content

Commit c9e2aa4

Browse files
committed
refactor: remove a redundant mutable variable
1 parent 2557603 commit c9e2aa4

File tree

1 file changed

+3
-4
lines changed
  • compiler/rustc_trait_selection/src/traits

1 file changed

+3
-4
lines changed

Diff for: compiler/rustc_trait_selection/src/traits/fulfill.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,6 @@ impl<'a, 'tcx> FulfillmentContext<'tcx> {
131131
let span = debug_span!("select", obligation_forest_size = ?self.predicates.len());
132132
let _enter = span.enter();
133133

134-
let mut errors = Vec::new();
135-
136134
// Process pending obligations.
137135
let outcome: Outcome<_, _> = self.predicates.process_obligations(&mut FulfillProcessor {
138136
selcx,
@@ -142,7 +140,8 @@ impl<'a, 'tcx> FulfillmentContext<'tcx> {
142140
// FIXME: if we kept the original cache key, we could mark projection
143141
// obligations as complete for the projection cache here.
144142

145-
errors.extend(outcome.errors.into_iter().map(to_fulfillment_error));
143+
let errors: Vec<FulfillmentError<'tcx>> =
144+
outcome.errors.into_iter().map(to_fulfillment_error).collect();
146145

147146
debug!(
148147
"select({} predicates remaining, {} errors) done",
@@ -728,7 +727,7 @@ impl<'a, 'b, 'tcx> FulfillProcessor<'a, 'b, 'tcx> {
728727
}
729728
return ProcessResult::Changed(vec![]);
730729
} else {
731-
tracing::debug!("Does NOT hold: {:?}", obligation);
730+
debug!("Does NOT hold: {:?}", obligation);
732731
}
733732
}
734733

0 commit comments

Comments
 (0)