Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: remove a redundant mutable variable #98921

Merged
merged 1 commit into from
Jul 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions compiler/rustc_trait_selection/src/traits/fulfill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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",
Expand Down Expand Up @@ -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);
}
}

Expand Down