rustc: Flatten recursive vectors in trans::simplify_type(). Prevents an infinite loop.
This commit is contained in:
parent
b163247d4e
commit
5295a4dabd
@ -1231,6 +1231,9 @@ fn simplify_type(&@crate_ctxt ccx, &ty::t typ) -> ty::t {
|
||||
case (ty::ty_box(_)) {
|
||||
ret ty::mk_imm_box(ccx.tcx, ty::mk_nil(ccx.tcx));
|
||||
}
|
||||
case (ty::ty_vec(_)) {
|
||||
ret ty::mk_imm_vec(ccx.tcx, ty::mk_nil(ccx.tcx));
|
||||
}
|
||||
case (_) { ret typ; }
|
||||
}
|
||||
}
|
||||
|
@ -427,6 +427,11 @@ fn mk_imm_box(&ctxt cx, &t ty) -> t {
|
||||
}
|
||||
|
||||
fn mk_vec(&ctxt cx, &mt tm) -> t { ret gen_ty(cx, ty_vec(tm)); }
|
||||
|
||||
fn mk_imm_vec(&ctxt cx, &t typ) -> t {
|
||||
ret gen_ty(cx, ty_vec(rec(ty=typ, mut=ast::imm)));
|
||||
}
|
||||
|
||||
fn mk_port(&ctxt cx, &t ty) -> t { ret gen_ty(cx, ty_port(ty)); }
|
||||
fn mk_chan(&ctxt cx, &t ty) -> t { ret gen_ty(cx, ty_chan(ty)); }
|
||||
fn mk_task(&ctxt cx) -> t { ret gen_ty(cx, ty_task); }
|
||||
|
Loading…
x
Reference in New Issue
Block a user