Skip to content

Commit cb66784

Browse files
committed
---
yaml --- r: 13503 b: refs/heads/master c: 7b98fdd h: refs/heads/master i: 13501: 21ad4ad 13499: 54ef31c 13495: 0125c42 13487: d7c8386 13471: 44deac9 13439: accb9a9 v: v3
1 parent 3ffc85a commit cb66784

File tree

6 files changed

+50
-2
lines changed

6 files changed

+50
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: e3f73e443e265ee82ad9aa2825c2c5347ac2d3d4
2+
refs/heads/master: 7b98fdd2699dfcc61499c3c4310c49ded7ea4670
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/src/rustc/middle/trans/native.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -812,6 +812,26 @@ fn trans_intrinsic(ccx: @crate_ctxt, decl: ValueRef, item: @ast::native_item,
812812
Store(bcx, C_uint(ccx, shape::llsize_of_real(ccx, lltp_ty)),
813813
fcx.llretptr);
814814
}
815+
"move_val" {
816+
let tp_ty = substs.tys[0];
817+
let src = {bcx: bcx,
818+
val: get_param(decl, first_real_arg + 1u),
819+
kind: owned };
820+
bcx = move_val(bcx, DROP_EXISTING,
821+
get_param(decl, first_real_arg),
822+
src,
823+
tp_ty);
824+
}
825+
"move_val_init" {
826+
let tp_ty = substs.tys[0];
827+
let src = {bcx: bcx,
828+
val: get_param(decl, first_real_arg + 1u),
829+
kind: owned };
830+
bcx = move_val(bcx, INIT,
831+
get_param(decl, first_real_arg),
832+
src,
833+
tp_ty);
834+
}
815835
"min_align_of" {
816836
let tp_ty = substs.tys[0];
817837
let lltp_ty = type_of::type_of(ccx, tp_ty);

trunk/src/rustc/middle/trans/type_use.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ fn type_uses_for(ccx: @crate_ctxt, fn_id: def_id, n_tps: uint)
7979
let flags = alt check *i.ident {
8080
"visit_ty" { 3u }
8181
"size_of" | "pref_align_of" | "min_align_of" |
82-
"init" | "reinterpret_cast" { use_repr }
82+
"init" | "reinterpret_cast" | "move_val" | "move_val_init" {
83+
use_repr
84+
}
8385
"get_tydesc" | "needs_drop" { use_tydesc }
8486
"forget" | "addr_of" { 0u }
8587
};

trunk/src/rustc/middle/typeck/check.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,7 @@ impl methods for @fn_ctxt {
454454
none { result::err("no block is in scope here") }
455455
}
456456
}
457+
#[inline(always)]
457458
fn write_ty(node_id: ast::node_id, ty: ty::t) {
458459
#debug["write_ty(%d, %s) in fcx %s",
459460
node_id, ty_to_str(self.tcx(), ty), self.tag()];
@@ -2303,6 +2304,11 @@ fn check_intrinsic_type(ccx: @crate_ctxt, it: @ast::native_item) {
23032304
param(ccx, 1u)) }
23042305
"addr_of" { (1u, [arg(ast::by_ref, param(ccx, 0u))],
23052306
ty::mk_imm_ptr(tcx, param(ccx, 0u))) }
2307+
"move_val" | "move_val_init" {
2308+
(1u, [arg(ast::by_mutbl_ref, param(ccx, 0u)),
2309+
arg(ast::by_move, param(ccx, 0u))],
2310+
ty::mk_nil(tcx))
2311+
}
23062312
"needs_drop" { (1u, [], ty::mk_bool(tcx)) }
23072313

23082314
"visit_ty" {

trunk/src/snapshots.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
S 2012-06-14 623d825
2+
macos-x86_64 ab8d81cf3f538cd259cbec2be9615688482f9bc1
3+
macos-i386 1ec2b3425fab510684858bb7b28f2c2ad474d5af
4+
freebsd-x86_64 f5d4c97cc8900c3eb24584ec3234abd7884b9598
5+
linux-x86_64 dc6a402bc4b25510af6166c62cdb9f77a62b3e28
6+
linux-i386 c70b86e8065b9a41d71876a05940f1a07da26d46
7+
winnt-i386 b576dd7db9c1b4fcc7c2363c5f6856d021945402
8+
19
S 2012-06-12 11e30b2
210
macos-x86_64 b6e031112f4619dcd5aa708cf9ea9871a7b11595
311
macos-i386 497875c1fb6289c704485b8bf2e3c40c7918bf4e
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#[abi = "rust-intrinsic"]
2+
native mod rusti {
3+
fn move_val_init<T>(&dst: T, -src: T);
4+
fn move_val<T>(&dst: T, -src: T);
5+
}
6+
7+
fn main() {
8+
let mut x = @1;
9+
let mut y = @2;
10+
rusti::move_val(y, x);
11+
assert *y == 1;
12+
}

0 commit comments

Comments
 (0)