Skip to content

Commit 06b93c0

Browse files
committed
---
yaml --- r: 36695 b: refs/heads/try2 c: a277081 h: refs/heads/master i: 36693: d958bbc 36691: ff7aa45 36687: ae5094b v: v3
1 parent 204e6e8 commit 06b93c0

27 files changed

+103
-97
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
55
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: cd120736cbe9a8157a8d0e3fb66f48a32545ef68
8+
refs/heads/try2: a277081ee481174cd28f7e85aaf1c4de912cbf4f
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
1010
refs/heads/dist-snap: 22efa39382d41b084fde1719df7ae8ce5697d8c9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try2/src/libcore/core.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ pub mod util;
167167

168168
/* Reexported core operators */
169169

170-
pub use kinds::{Const, Copy, Send, Owned};
170+
pub use kinds::{Const, Copy, Send, Durable};
171171
pub use ops::{Drop};
172172
pub use ops::{Add, Sub, Mul, Div, Modulo, Neg};
173173
pub use ops::{BitAnd, BitOr, BitXor};

branches/try2/src/libcore/kinds.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ The 4 kinds are
3030
* Const - types that are deeply immutable. Const types are used for
3131
freezable data structures.
3232
33-
* Owned - types that do not contain borrowed pointers. Note that this
34-
meaning of 'owned' conflicts with 'owned pointers'. The two notions
35-
of ownership are different.
33+
* Durable - types that do not contain borrowed pointers.
3634
3735
`Copy` types include both implicitly copyable types that the compiler
3836
will copy automatically and non-implicitly copyable types that require
@@ -56,7 +54,16 @@ pub trait Const {
5654
// Empty.
5755
}
5856

57+
#[cfg(stage0)]
5958
#[lang="owned"]
60-
pub trait Owned {
59+
pub trait Durable {
60+
// Empty.
61+
}
62+
63+
#[cfg(stage1)]
64+
#[cfg(stage2)]
65+
#[cfg(stage3)]
66+
#[lang="durable"]
67+
pub trait Durable {
6168
// Empty.
6269
}

branches/try2/src/libcore/task/local_data.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ use task::local_data_priv::{
4747
*
4848
* These two cases aside, the interface is safe.
4949
*/
50-
pub type LocalDataKey<T: Owned> = &fn(v: @T);
50+
pub type LocalDataKey<T: Durable> = &fn(v: @T);
5151

5252
/**
5353
* Remove a task-local data value from the table, returning the
5454
* reference that was originally created to insert it.
5555
*/
56-
pub unsafe fn local_data_pop<T: Owned>(
56+
pub unsafe fn local_data_pop<T: Durable>(
5757
key: LocalDataKey<T>) -> Option<@T> {
5858

5959
local_pop(rt::rust_get_task(), key)
@@ -62,7 +62,7 @@ pub unsafe fn local_data_pop<T: Owned>(
6262
* Retrieve a task-local data value. It will also be kept alive in the
6363
* table until explicitly removed.
6464
*/
65-
pub unsafe fn local_data_get<T: Owned>(
65+
pub unsafe fn local_data_get<T: Durable>(
6666
key: LocalDataKey<T>) -> Option<@T> {
6767

6868
local_get(rt::rust_get_task(), key)
@@ -71,7 +71,7 @@ pub unsafe fn local_data_get<T: Owned>(
7171
* Store a value in task-local data. If this key already has a value,
7272
* that value is overwritten (and its destructor is run).
7373
*/
74-
pub unsafe fn local_data_set<T: Owned>(
74+
pub unsafe fn local_data_set<T: Durable>(
7575
key: LocalDataKey<T>, data: @T) {
7676

7777
local_set(rt::rust_get_task(), key, data)
@@ -80,7 +80,7 @@ pub unsafe fn local_data_set<T: Owned>(
8080
* Modify a task-local data value. If the function returns 'None', the
8181
* data is removed (and its reference dropped).
8282
*/
83-
pub unsafe fn local_data_modify<T: Owned>(
83+
pub unsafe fn local_data_modify<T: Durable>(
8484
key: LocalDataKey<T>,
8585
modify_fn: fn(Option<@T>) -> Option<@T>) {
8686

branches/try2/src/libcore/task/local_data_priv.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use rt::rust_task;
1919
type rust_task = libc::c_void;
2020

2121
pub trait LocalData { }
22-
impl<T: Owned> @T: LocalData { }
22+
impl<T: Durable> @T: LocalData { }
2323

2424
impl LocalData: Eq {
2525
pure fn eq(&self, other: &@LocalData) -> bool unsafe {
@@ -67,7 +67,7 @@ unsafe fn get_task_local_map(task: *rust_task) -> TaskLocalMap {
6767
}
6868
}
6969

70-
unsafe fn key_to_key_value<T: Owned>(
70+
unsafe fn key_to_key_value<T: Durable>(
7171
key: LocalDataKey<T>) -> *libc::c_void {
7272

7373
// Keys are closures, which are (fnptr,envptr) pairs. Use fnptr.
@@ -77,7 +77,7 @@ unsafe fn key_to_key_value<T: Owned>(
7777
}
7878

7979
// If returning Some(..), returns with @T with the map's reference. Careful!
80-
unsafe fn local_data_lookup<T: Owned>(
80+
unsafe fn local_data_lookup<T: Durable>(
8181
map: TaskLocalMap, key: LocalDataKey<T>)
8282
-> Option<(uint, *libc::c_void)> {
8383

@@ -95,7 +95,7 @@ unsafe fn local_data_lookup<T: Owned>(
9595
}
9696
}
9797

98-
unsafe fn local_get_helper<T: Owned>(
98+
unsafe fn local_get_helper<T: Durable>(
9999
task: *rust_task, key: LocalDataKey<T>,
100100
do_pop: bool) -> Option<@T> {
101101

@@ -117,21 +117,21 @@ unsafe fn local_get_helper<T: Owned>(
117117
}
118118

119119

120-
pub unsafe fn local_pop<T: Owned>(
120+
pub unsafe fn local_pop<T: Durable>(
121121
task: *rust_task,
122122
key: LocalDataKey<T>) -> Option<@T> {
123123

124124
local_get_helper(task, key, true)
125125
}
126126

127-
pub unsafe fn local_get<T: Owned>(
127+
pub unsafe fn local_get<T: Durable>(
128128
task: *rust_task,
129129
key: LocalDataKey<T>) -> Option<@T> {
130130

131131
local_get_helper(task, key, false)
132132
}
133133

134-
pub unsafe fn local_set<T: Owned>(
134+
pub unsafe fn local_set<T: Durable>(
135135
task: *rust_task, key: LocalDataKey<T>, data: @T) {
136136

137137
let map = get_task_local_map(task);
@@ -163,7 +163,7 @@ pub unsafe fn local_set<T: Owned>(
163163
}
164164
}
165165

166-
pub unsafe fn local_modify<T: Owned>(
166+
pub unsafe fn local_modify<T: Durable>(
167167
task: *rust_task, key: LocalDataKey<T>,
168168
modify_fn: fn(Option<@T>) -> Option<@T>) {
169169

branches/try2/src/librustc/metadata/tydecode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ fn parse_bounds(st: @pstate, conv: conv_did) -> @~[ty::param_bound] {
487487
'S' => ty::bound_send,
488488
'C' => ty::bound_copy,
489489
'K' => ty::bound_const,
490-
'O' => ty::bound_owned,
490+
'O' => ty::bound_durable,
491491
'I' => ty::bound_trait(parse_ty(st, conv)),
492492
'.' => break,
493493
_ => fail ~"parse_bounds: bad bounds"

branches/try2/src/librustc/metadata/tyencode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ fn enc_bounds(w: io::Writer, cx: @ctxt, bs: @~[ty::param_bound]) {
395395
ty::bound_send => w.write_char('S'),
396396
ty::bound_copy => w.write_char('C'),
397397
ty::bound_const => w.write_char('K'),
398-
ty::bound_owned => w.write_char('O'),
398+
ty::bound_durable => w.write_char('O'),
399399
ty::bound_trait(tp) => {
400400
w.write_char('I');
401401
enc_ty(w, cx, tp);

branches/try2/src/librustc/middle/kind.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ fn kind_to_str(k: Kind) -> ~str {
6464

6565
if ty::kind_can_be_sent(k) {
6666
kinds.push(~"send");
67-
} else if ty::kind_is_owned(k) {
68-
kinds.push(~"owned");
67+
} else if ty::kind_is_durable(k) {
68+
kinds.push(~"durable");
6969
}
7070

7171
str::connect(kinds, ~" ")
@@ -136,7 +136,7 @@ fn with_appropriate_checker(cx: ctx, id: node_id, b: fn(check_fn)) {
136136
fn check_for_box(cx: ctx, id: node_id, fv: Option<@freevar_entry>,
137137
is_move: bool, var_t: ty::t, sp: span) {
138138
// all captured data must be owned
139-
if !check_owned(cx.tcx, var_t, sp) { return; }
139+
if !check_durable(cx.tcx, var_t, sp) { return; }
140140

141141
// copied in data must be copyable, but moved in data can be anything
142142
let is_implicit = fv.is_some();
@@ -555,12 +555,12 @@ fn check_send(cx: ctx, ty: ty::t, sp: span) -> bool {
555555
}
556556

557557
// note: also used from middle::typeck::regionck!
558-
fn check_owned(tcx: ty::ctxt, ty: ty::t, sp: span) -> bool {
559-
if !ty::kind_is_owned(ty::type_kind(tcx, ty)) {
558+
fn check_durable(tcx: ty::ctxt, ty: ty::t, sp: span) -> bool {
559+
if !ty::kind_is_durable(ty::type_kind(tcx, ty)) {
560560
match ty::get(ty).sty {
561561
ty::ty_param(*) => {
562562
tcx.sess.span_err(sp, ~"value may contain borrowed \
563-
pointers; use `owned` bound");
563+
pointers; use `durable` bound");
564564
}
565565
_ => {
566566
tcx.sess.span_err(sp, ~"value may contain borrowed \
@@ -632,7 +632,7 @@ fn check_cast_for_escaping_regions(
632632
if target_params.contains(&source_param) {
633633
/* case (2) */
634634
} else {
635-
check_owned(cx.tcx, ty, source.span); /* case (3) */
635+
check_durable(cx.tcx, ty, source.span); /* case (3) */
636636
}
637637
}
638638
_ => {}

branches/try2/src/librustc/middle/lang_items.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ struct LanguageItems {
3636
mut const_trait: Option<def_id>,
3737
mut copy_trait: Option<def_id>,
3838
mut send_trait: Option<def_id>,
39-
mut owned_trait: Option<def_id>,
39+
mut durable_trait: Option<def_id>,
4040

4141
mut drop_trait: Option<def_id>,
4242

@@ -69,7 +69,7 @@ mod language_items {
6969
const_trait: None,
7070
copy_trait: None,
7171
send_trait: None,
72-
owned_trait: None,
72+
durable_trait: None,
7373

7474
drop_trait: None,
7575

@@ -106,7 +106,7 @@ fn LanguageItemCollector(crate: @crate, session: Session,
106106
item_refs.insert(~"const", &mut items.const_trait);
107107
item_refs.insert(~"copy", &mut items.copy_trait);
108108
item_refs.insert(~"send", &mut items.send_trait);
109-
item_refs.insert(~"owned", &mut items.owned_trait);
109+
item_refs.insert(~"durable", &mut items.durable_trait);
110110

111111
item_refs.insert(~"drop", &mut items.drop_trait);
112112

0 commit comments

Comments
 (0)