1
Fork 0

librustc: Make &fn by-copy by default and remove the mode from frame_address.

This commit is contained in:
Patrick Walton 2013-04-22 21:54:29 -07:00
parent 17723d18de
commit a12a3db5b4
3 changed files with 4 additions and 9 deletions

View file

@ -93,7 +93,10 @@ pub mod rustrt {
pub mod rusti {
#[abi = "rust-intrinsic"]
pub extern "rust-intrinsic" {
#[cfg(stage0)]
pub fn frame_address(f: &once fn(x: *u8));
#[cfg(not(stage0))]
pub fn frame_address(+f: &once fn(x: *u8));
}
}

View file

@ -1259,14 +1259,6 @@ pub fn mach_sty(cfg: @session::config, t: t) -> sty {
}
pub fn default_arg_mode_for_ty(tcx: ctxt, ty: ty::t) -> ast::rmode {
// FIXME(#2202) --- We retain by-ref for &fn things to workaround a
// memory leak that otherwise results when @fn is upcast to &fn.
match ty::get(ty).sty {
ty::ty_closure(ClosureTy {sigil: ast::BorrowedSigil, _}) => {
return ast::by_ref;
}
_ => {}
}
return if tcx.legacy_modes {
if type_is_borrowed(ty) {
// the old mode default was ++ for things like &ptr, but to be

View file

@ -3496,7 +3496,7 @@ pub fn check_intrinsic_type(ccx: @mut CrateCtxt, it: @ast::foreign_item) {
output: ty::mk_nil()
}
});
(0u, ~[arg(ast::by_ref, fty)], ty::mk_nil())
(0u, ~[arg(ast::by_copy, fty)], ty::mk_nil())
}
~"morestack_addr" => {
(0u, ~[], ty::mk_nil_ptr(ccx.tcx))