diff --git a/src/librustc/middle/traits/select.rs b/src/librustc/middle/traits/select.rs index 9dbcf455f4b5..2604204d9e63 100644 --- a/src/librustc/middle/traits/select.rs +++ b/src/librustc/middle/traits/select.rs @@ -1024,7 +1024,9 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { 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(()); } @@ -1705,7 +1707,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { abi: abi::Rust, ref sig }) => { - (*sig).clone() + sig } _ => { self.tcx().sess.span_bug( diff --git a/src/librustc_trans/trans/context.rs b/src/librustc_trans/trans/context.rs index eedfd8df2c0a..8220645cec78 100644 --- a/src/librustc_trans/trans/context.rs +++ b/src/librustc_trans/trans/context.rs @@ -395,6 +395,7 @@ impl<'tcx> LocalCrateContext<'tcx> { 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),