]> git.lizzy.rs Git - rust.git/commitdiff
Adjust nits from pcwalton.
authorNiko Matsakis <niko@alum.mit.edu>
Thu, 4 Dec 2014 05:57:38 +0000 (00:57 -0500)
committerNiko Matsakis <niko@alum.mit.edu>
Thu, 4 Dec 2014 06:49:42 +0000 (01:49 -0500)
src/librustc/middle/traits/select.rs
src/librustc_trans/trans/context.rs

index 9dbcf455f4b58b91d1e6e17abda8dbfba5039cf3..2604204d9e63f9f228640b6c94e991f3f44ee25d 100644 (file)
@@ -1024,7 +1024,9 @@ fn assemble_fn_pointer_candidates(&mut self,
                                       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 @@ fn confirm_fn_pointer_candidate(&mut self,
                 abi: abi::Rust,
                 ref sig
             }) => {
-                (*sig).clone()
+                sig
             }
             _ => {
                 self.tcx().sess.span_bug(
index eedfd8df2c0abe295fcb379043d4427e0a0b413e..8220645cec78b59cc17cb8dc0e4e2fc8dda0b7c9 100644 (file)
@@ -395,6 +395,7 @@ fn new(shared: &SharedCrateContext<'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),