substs: rcvr_substs
})
}
- traits::VtableBuiltin(..) if Some(trait_id) == tcx.lang_items().clone_trait() => {
- Some(Instance {
- def: ty::InstanceDef::CloneShim(def_id, trait_ref.self_ty()),
- substs: rcvr_substs
- })
- }
- _ => {
- None
+ traits::VtableBuiltin(..) => {
+ if let Some(_) = tcx.lang_items().clone_trait() {
+ Some(Instance {
+ def: ty::InstanceDef::CloneShim(def_id, trait_ref.self_ty()),
+ substs: rcvr_substs
+ })
+ } else {
+ None
+ }
}
+ traits::VtableDefaultImpl(..) | traits::VtableParam(..) => None
}
}
//
// These are both the same at trans time.
Ok(true)
- }
- _ => Err(()),
+ }
+ (ty::ClosureKind::FnMut, _) |
+ (ty::ClosureKind::FnOnce, _) => Err(())
}
}