rustc: Only generalize on definition types that can actually be parametric
This commit is contained in:
parent
680e858d61
commit
a6c6e8679e
@ -1767,7 +1767,7 @@ fn check_expr(&fn_ctxt fcx, @ast.expr expr) -> @ast.expr {
|
||||
}
|
||||
case (ast.def_fn(?id)) {
|
||||
check (fcx.ccx.item_types.contains_key(id));
|
||||
t = fcx.ccx.item_types.get(id);
|
||||
t = generalize_ty(fcx.ccx, fcx.ccx.item_types.get(id));
|
||||
}
|
||||
case (ast.def_const(?id)) {
|
||||
check (fcx.ccx.item_types.contains_key(id));
|
||||
@ -1783,7 +1783,7 @@ fn check_expr(&fn_ctxt fcx, @ast.expr expr) -> @ast.expr {
|
||||
}
|
||||
case (ast.def_obj(?id)) {
|
||||
check (fcx.ccx.item_types.contains_key(id));
|
||||
t = fcx.ccx.item_types.get(id);
|
||||
t = generalize_ty(fcx.ccx, fcx.ccx.item_types.get(id));
|
||||
}
|
||||
|
||||
case (_) {
|
||||
@ -1794,8 +1794,6 @@ fn check_expr(&fn_ctxt fcx, @ast.expr expr) -> @ast.expr {
|
||||
}
|
||||
}
|
||||
|
||||
t = generalize_ty(fcx.ccx, t);
|
||||
|
||||
ret @fold.respan[ast.expr_](expr.span,
|
||||
ast.expr_name(name, defopt,
|
||||
ast.ann_type(t)));
|
||||
|
Loading…
x
Reference in New Issue
Block a user