Skip to content

Commit 3df7ed1

Browse files
committed
Remove Durable from the language
1 parent 1755eec commit 3df7ed1

File tree

5 files changed

+82
-91
lines changed

5 files changed

+82
-91
lines changed

src/libcore/core.rc

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ they contained the following prologue:
7272

7373
/* Reexported core operators */
7474

75-
pub use kinds::{Const, Copy, Owned, Durable};
75+
pub use kinds::{Const, Copy, Owned};
7676
pub use ops::{Drop};
7777
pub use ops::{Add, Sub, Mul, Div, Rem, Neg, Not};
7878
pub use ops::{BitAnd, BitOr, BitXor};

src/libcore/kinds.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ The 4 kinds are
3030
* Const - types that are deeply immutable. Const types are used for
3131
freezable data structures.
3232
33-
* Durable - types that do not contain borrowed pointers.
34-
3533
`Copy` types include both implicitly copyable types that the compiler
3634
will copy automatically and non-implicitly copyable types that require
3735
the `copy` keyword to copy. Types that do not implement `Copy` may
@@ -55,6 +53,7 @@ pub trait Const {
5553
}
5654

5755
#[lang="durable"]
56+
#[cfg(stage0)]
5857
pub trait Durable {
5958
// Empty.
6059
}

src/libcore/prelude.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
/* Reexported core operators */
1414

1515
pub use either::{Either, Left, Right};
16-
pub use kinds::{Const, Copy, Owned, Durable};
16+
pub use kinds::{Const, Copy, Owned};
1717
pub use ops::{Add, Sub, Mul, Div, Rem, Neg, Not};
1818
pub use ops::{BitAnd, BitOr, BitXor};
1919
pub use ops::{Drop};

src/librustc/middle/lang_items.rs

+79-85
Original file line numberDiff line numberDiff line change
@@ -34,56 +34,55 @@ pub enum LangItem {
3434
ConstTraitLangItem, // 0
3535
CopyTraitLangItem, // 1
3636
OwnedTraitLangItem, // 2
37-
DurableTraitLangItem, // 3
38-
39-
DropTraitLangItem, // 4
40-
41-
AddTraitLangItem, // 5
42-
SubTraitLangItem, // 6
43-
MulTraitLangItem, // 7
44-
DivTraitLangItem, // 8
45-
RemTraitLangItem, // 9
46-
NegTraitLangItem, // 10
47-
NotTraitLangItem, // 11
48-
BitXorTraitLangItem, // 12
49-
BitAndTraitLangItem, // 13
50-
BitOrTraitLangItem, // 14
51-
ShlTraitLangItem, // 15
52-
ShrTraitLangItem, // 16
53-
IndexTraitLangItem, // 17
54-
55-
EqTraitLangItem, // 18
56-
OrdTraitLangItem, // 19
57-
58-
StrEqFnLangItem, // 20
59-
UniqStrEqFnLangItem, // 21
60-
AnnihilateFnLangItem, // 22
61-
LogTypeFnLangItem, // 23
62-
FailFnLangItem, // 24
63-
FailBoundsCheckFnLangItem, // 25
64-
ExchangeMallocFnLangItem, // 26
65-
ExchangeFreeFnLangItem, // 27
66-
MallocFnLangItem, // 28
67-
FreeFnLangItem, // 29
68-
BorrowAsImmFnLangItem, // 30
69-
BorrowAsMutFnLangItem, // 31
70-
ReturnToMutFnLangItem, // 32
71-
CheckNotBorrowedFnLangItem, // 33
72-
StrDupUniqFnLangItem, // 34
73-
RecordBorrowFnLangItem, // 35
74-
UnrecordBorrowFnLangItem, // 36
75-
76-
StartFnLangItem, // 37
37+
38+
DropTraitLangItem, // 3
39+
40+
AddTraitLangItem, // 4
41+
SubTraitLangItem, // 5
42+
MulTraitLangItem, // 6
43+
DivTraitLangItem, // 7
44+
RemTraitLangItem, // 8
45+
NegTraitLangItem, // 9
46+
NotTraitLangItem, // 10
47+
BitXorTraitLangItem, // 11
48+
BitAndTraitLangItem, // 12
49+
BitOrTraitLangItem, // 13
50+
ShlTraitLangItem, // 14
51+
ShrTraitLangItem, // 15
52+
IndexTraitLangItem, // 16
53+
54+
EqTraitLangItem, // 17
55+
OrdTraitLangItem, // 18
56+
57+
StrEqFnLangItem, // 19
58+
UniqStrEqFnLangItem, // 20
59+
AnnihilateFnLangItem, // 21
60+
LogTypeFnLangItem, // 22
61+
FailFnLangItem, // 23
62+
FailBoundsCheckFnLangItem, // 24
63+
ExchangeMallocFnLangItem, // 25
64+
ExchangeFreeFnLangItem, // 26
65+
MallocFnLangItem, // 27
66+
FreeFnLangItem, // 28
67+
BorrowAsImmFnLangItem, // 29
68+
BorrowAsMutFnLangItem, // 30
69+
ReturnToMutFnLangItem, // 31
70+
CheckNotBorrowedFnLangItem, // 32
71+
StrDupUniqFnLangItem, // 33
72+
RecordBorrowFnLangItem, // 34
73+
UnrecordBorrowFnLangItem, // 35
74+
75+
StartFnLangItem, // 36
7776
}
7877

7978
pub struct LanguageItems {
80-
items: [Option<def_id>, ..38]
79+
items: [Option<def_id>, ..37]
8180
}
8281

8382
pub impl LanguageItems {
8483
pub fn new() -> LanguageItems {
8584
LanguageItems {
86-
items: [ None, ..38 ]
85+
items: [ None, ..37 ]
8786
}
8887
}
8988

@@ -100,45 +99,44 @@ pub impl LanguageItems {
10099
0 => "const",
101100
1 => "copy",
102101
2 => "owned",
103-
3 => "durable",
104-
105-
4 => "drop",
106-
107-
5 => "add",
108-
6 => "sub",
109-
7 => "mul",
110-
8 => "div",
111-
9 => "rem",
112-
10 => "neg",
113-
11 => "not",
114-
12 => "bitxor",
115-
13 => "bitand",
116-
14 => "bitor",
117-
15 => "shl",
118-
16 => "shr",
119-
17 => "index",
120-
18 => "eq",
121-
19 => "ord",
122-
123-
20 => "str_eq",
124-
21 => "uniq_str_eq",
125-
22 => "annihilate",
126-
23 => "log_type",
127-
24 => "fail_",
128-
25 => "fail_bounds_check",
129-
26 => "exchange_malloc",
130-
27 => "exchange_free",
131-
28 => "malloc",
132-
29 => "free",
133-
30 => "borrow_as_imm",
134-
31 => "borrow_as_mut",
135-
32 => "return_to_mut",
136-
33 => "check_not_borrowed",
137-
34 => "strdup_uniq",
138-
35 => "record_borrow",
139-
36 => "unrecord_borrow",
140-
141-
37 => "start",
102+
103+
3 => "drop",
104+
105+
4 => "add",
106+
5 => "sub",
107+
6 => "mul",
108+
7 => "div",
109+
8 => "rem",
110+
9 => "neg",
111+
10 => "not",
112+
11 => "bitxor",
113+
12 => "bitand",
114+
13 => "bitor",
115+
14 => "shl",
116+
15 => "shr",
117+
16 => "index",
118+
17 => "eq",
119+
18 => "ord",
120+
121+
19 => "str_eq",
122+
20 => "uniq_str_eq",
123+
21 => "annihilate",
124+
22 => "log_type",
125+
23 => "fail_",
126+
24 => "fail_bounds_check",
127+
25 => "exchange_malloc",
128+
26 => "exchange_free",
129+
27 => "malloc",
130+
28 => "free",
131+
29 => "borrow_as_imm",
132+
30 => "borrow_as_mut",
133+
31 => "return_to_mut",
134+
32 => "check_not_borrowed",
135+
33 => "strdup_uniq",
136+
34 => "record_borrow",
137+
35 => "unrecord_borrow",
138+
139+
36 => "start",
142140

143141
_ => "???"
144142
}
@@ -155,9 +153,6 @@ pub impl LanguageItems {
155153
pub fn owned_trait(&const self) -> def_id {
156154
self.items[OwnedTraitLangItem as uint].get()
157155
}
158-
pub fn durable_trait(&const self) -> def_id {
159-
self.items[DurableTraitLangItem as uint].get()
160-
}
161156

162157
pub fn drop_trait(&const self) -> def_id {
163158
self.items[DropTraitLangItem as uint].get()
@@ -274,7 +269,6 @@ fn LanguageItemCollector(crate: @crate,
274269
item_refs.insert(@~"const", ConstTraitLangItem as uint);
275270
item_refs.insert(@~"copy", CopyTraitLangItem as uint);
276271
item_refs.insert(@~"owned", OwnedTraitLangItem as uint);
277-
item_refs.insert(@~"durable", DurableTraitLangItem as uint);
278272

279273
item_refs.insert(@~"drop", DropTraitLangItem as uint);
280274

src/librustc/middle/typeck/collect.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1178,8 +1178,6 @@ pub fn ty_generics(ccx: &CrateCtxt,
11781178
~[ty::bound_copy]
11791179
} else if trait_ref.def_id == li.const_trait() {
11801180
~[ty::bound_const]
1181-
} else if trait_ref.def_id == li.durable_trait() {
1182-
~[ty::bound_durable]
11831181
} else {
11841182
// Must be a user-defined trait
11851183
~[ty::bound_trait(trait_ref)]

0 commit comments

Comments
 (0)