]> git.lizzy.rs Git - rust.git/commitdiff
Removed some dead code.
authorFelix S. Klock II <pnkfelix@pnkfx.org>
Fri, 29 Nov 2013 17:20:27 +0000 (18:20 +0100)
committerFelix S. Klock II <pnkfelix@pnkfx.org>
Fri, 29 Nov 2013 17:20:27 +0000 (18:20 +0100)
While tracking down how this function became dead, identified a spot
(@fn cannot happen) where we probably would prefer to ICE rather than
pass silently; so added fail! invocation.

src/librustc/middle/kind.rs

index a4348a71d214f61a57a02c98739fcb3c10797546..bd6e7d528a7e00c7398af7917f37213ebea722bf 100644 (file)
@@ -182,17 +182,6 @@ fn check_for_uniq(cx: &Context, fv: &freevar_entry, bounds: ty::BuiltinBounds) {
         check_freevar_bounds(cx, fv.span, var_t, bounds, None);
     }
 
-    fn check_for_box(cx: &Context, fv: &freevar_entry, bounds: ty::BuiltinBounds) {
-        // all captured data must be owned
-        let id = ast_util::def_id_of_def(fv.def).node;
-        let var_t = ty::node_id_to_type(cx.tcx, id);
-
-        // check that only immutable variables are implicitly copied in
-        check_imm_free_var(cx, fv.def, fv.span);
-
-        check_freevar_bounds(cx, fv.span, var_t, bounds, None);
-    }
-
     fn check_for_block(cx: &Context, fv: &freevar_entry,
                        bounds: ty::BuiltinBounds, region: ty::Region) {
         let id = ast_util::def_id_of_def(fv.def).node;
@@ -225,6 +214,7 @@ fn check_for_bare(cx: &Context, fv: @freevar_entry) {
             ..
         }) => {
             // can't happen
+            fail!("internal error: saw closure with managed sigil (@fn)");
         }
         ty::ty_closure(ty::ClosureTy {
             sigil: BorrowedSigil,