librustc: Make &fn by-copy by default and remove the mode from frame_address.
This commit is contained in:
@@ -93,7 +93,10 @@ pub mod rustrt {
|
|||||||
pub mod rusti {
|
pub mod rusti {
|
||||||
#[abi = "rust-intrinsic"]
|
#[abi = "rust-intrinsic"]
|
||||||
pub extern "rust-intrinsic" {
|
pub extern "rust-intrinsic" {
|
||||||
|
#[cfg(stage0)]
|
||||||
pub fn frame_address(f: &once fn(x: *u8));
|
pub fn frame_address(f: &once fn(x: *u8));
|
||||||
|
#[cfg(not(stage0))]
|
||||||
|
pub fn frame_address(+f: &once fn(x: *u8));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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 {
|
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 {
|
return if tcx.legacy_modes {
|
||||||
if type_is_borrowed(ty) {
|
if type_is_borrowed(ty) {
|
||||||
// the old mode default was ++ for things like &ptr, but to be
|
// the old mode default was ++ for things like &ptr, but to be
|
||||||
|
|||||||
@@ -3496,7 +3496,7 @@ pub fn check_intrinsic_type(ccx: @mut CrateCtxt, it: @ast::foreign_item) {
|
|||||||
output: ty::mk_nil()
|
output: ty::mk_nil()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
(0u, ~[arg(ast::by_ref, fty)], ty::mk_nil())
|
(0u, ~[arg(ast::by_copy, fty)], ty::mk_nil())
|
||||||
}
|
}
|
||||||
~"morestack_addr" => {
|
~"morestack_addr" => {
|
||||||
(0u, ~[], ty::mk_nil_ptr(ccx.tcx))
|
(0u, ~[], ty::mk_nil_ptr(ccx.tcx))
|
||||||
|
|||||||
Reference in New Issue
Block a user