candidates: &mut CandidateSet<'tcx>)
-> Result<(),SelectionError<'tcx>>
{
- // We provide a `Fn` impl for fn pointers (but not e.g. `FnMut`).
+ // We provide a `Fn` impl for fn pointers. There is no need to provide
+ // the other traits (e.g. `FnMut`) since those are provided by blanket
+ // impls.
if Some(obligation.trait_ref.def_id) != self.tcx().lang_items.fn_trait() {
return Ok(());
}
abi: abi::Rust,
ref sig
}) => {
- (*sig).clone()
+ sig
}
_ => {
self.tcx().sess.span_bug(
tn: TypeNames::new(),
externs: RefCell::new(FnvHashMap::new()),
item_vals: RefCell::new(NodeMap::new()),
+ fn_pointer_shims: RefCell::new(FnvHashMap::new()),
drop_glues: RefCell::new(FnvHashMap::new()),
tydescs: RefCell::new(FnvHashMap::new()),
finished_tydescs: Cell::new(false),