mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
Push to result vector instead of allocating
Co-authored-by: lcnr <bastian_kauschke@hotmail.de>
This commit is contained in:
parent
45faeb43ae
commit
f0d0d87a20
@ -415,7 +415,7 @@ impl CStore {
|
||||
|
||||
let span = data.get_span(id.index, sess);
|
||||
|
||||
let attrs: Vec<_> = data.get_item_attrs(id.index, sess).collect();
|
||||
let attrs = data.get_item_attrs(id.index, sess).collect();
|
||||
|
||||
let ident = data.item_ident(id.index, sess);
|
||||
|
||||
|
@ -353,16 +353,13 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
||||
all_bounds.filter(|p| p.def_id() == stack.obligation.predicate.def_id());
|
||||
|
||||
// Keep only those bounds which may apply, and propagate overflow if it occurs.
|
||||
let mut param_candidates = vec![];
|
||||
for bound in matching_bounds {
|
||||
let wc = self.evaluate_where_clause(stack, bound)?;
|
||||
if wc.may_apply() {
|
||||
param_candidates.push(ParamCandidate(bound));
|
||||
candidates.vec.push(ParamCandidate(bound));
|
||||
}
|
||||
}
|
||||
|
||||
candidates.vec.extend(param_candidates);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user