librustc: Make &fn
by-copy by default and remove the mode from frame_address
.
This commit is contained in:
parent
17723d18de
commit
a12a3db5b4
3 changed files with 4 additions and 9 deletions
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue