mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-01 22:18:23 +03:00
needless clones
This commit is contained in:
@@ -20,8 +20,8 @@ pub fn get_vtable(&mut self, trait_ref: ty::PolyTraitRef<'tcx>) -> EvalResult<'t
|
||||
|
||||
debug!("get_vtable(trait_ref={:?})", trait_ref);
|
||||
|
||||
let methods: Vec<_> = traits::supertraits(tcx, trait_ref.clone()).flat_map(|trait_ref| {
|
||||
match self.fulfill_obligation(trait_ref.clone()) {
|
||||
let methods: Vec<_> = traits::supertraits(tcx, trait_ref).flat_map(|trait_ref| {
|
||||
match self.fulfill_obligation(trait_ref) {
|
||||
// Should default trait error here?
|
||||
traits::VtableDefaultImpl(_) |
|
||||
traits::VtableBuiltin(_) => {
|
||||
|
||||
+1
-1
@@ -314,7 +314,7 @@ pub fn get_closure(&self, id: AllocId) -> EvalResult<'tcx, (DefId, ClosureSubsts
|
||||
Some(&FunctionDefinition {
|
||||
def_id,
|
||||
kind: FunctionKind::Closure { ref substs, ref ty }
|
||||
}) => Ok((def_id, substs.clone(), ty.clone())),
|
||||
}) => Ok((def_id, *substs, ty.clone())),
|
||||
Some(&FunctionDefinition {
|
||||
kind: FunctionKind::Function { .. }, ..
|
||||
}) => Err(EvalError::CalledClosureAsFunction),
|
||||
|
||||
Reference in New Issue
Block a user