Skip to content

Commit fffa10c

Browse files
committed
Removed some dead code.
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.
1 parent 6c672ee commit fffa10c

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

src/librustc/middle/kind.rs

+1-11
Original file line numberDiff line numberDiff line change
@@ -182,17 +182,6 @@ fn with_appropriate_checker(cx: &Context,
182182
check_freevar_bounds(cx, fv.span, var_t, bounds, None);
183183
}
184184

185-
fn check_for_box(cx: &Context, fv: &freevar_entry, bounds: ty::BuiltinBounds) {
186-
// all captured data must be owned
187-
let id = ast_util::def_id_of_def(fv.def).node;
188-
let var_t = ty::node_id_to_type(cx.tcx, id);
189-
190-
// check that only immutable variables are implicitly copied in
191-
check_imm_free_var(cx, fv.def, fv.span);
192-
193-
check_freevar_bounds(cx, fv.span, var_t, bounds, None);
194-
}
195-
196185
fn check_for_block(cx: &Context, fv: &freevar_entry,
197186
bounds: ty::BuiltinBounds, region: ty::Region) {
198187
let id = ast_util::def_id_of_def(fv.def).node;
@@ -225,6 +214,7 @@ fn with_appropriate_checker(cx: &Context,
225214
..
226215
}) => {
227216
// can't happen
217+
fail!("internal error: saw closure with managed sigil (@fn)");
228218
}
229219
ty::ty_closure(ty::ClosureTy {
230220
sigil: BorrowedSigil,

0 commit comments

Comments
 (0)