mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-28 03:07:24 +03:00
Push to result vector instead of allocating
Co-authored-by: lcnr <bastian_kauschke@hotmail.de>
This commit is contained in:
@@ -415,7 +415,7 @@ pub fn load_macro_untracked(&self, id: DefId, sess: &Session) -> LoadedMacro {
|
||||
|
||||
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 @@ fn assemble_candidates_from_caller_bounds<'o>(
|
||||
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(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user