Skip to content

Commit 09cf638

Browse files
committed
---
yaml --- r: 68991 b: refs/heads/auto c: ad212ec h: refs/heads/master i: 68989: c00f20f 68987: 12be15b 68983: f7fdde0 68975: e9259a8 68959: 870668b 68927: fbfc6fb 68863: f8315f4 v: v3
1 parent b3af1fd commit 09cf638

File tree

21 files changed

+316
-177
lines changed

21 files changed

+316
-177
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: 4797dd4087104246b5d5c2d3edf1623acfbc06e5
17+
refs/heads/auto: ad212ecee47e8f9126c9fa4ea1679435136e854e
1818
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1919
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c

branches/auto/src/libextra/semver.rs

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,7 @@ impl cmp::Ord for Version {
113113
(0, _) => false,
114114
(_, 0) => true,
115115
(_, _) => self.pre < other.pre
116-
})) ||
117-
118-
(self.major == other.major &&
119-
self.minor == other.minor &&
120-
self.patch == other.patch &&
121-
self.pre == other.pre &&
122-
self.build < other.build)
116+
}))
123117
}
124118

125119
#[inline]
@@ -324,6 +318,8 @@ fn test_parse() {
324318
fn test_eq() {
325319
assert_eq!(parse("1.2.3"), parse("1.2.3"));
326320
assert_eq!(parse("1.2.3-alpha1"), parse("1.2.3-alpha1"));
321+
assert_eq!(parse("1.2.3+build.42"), parse("1.2.3+build.42"));
322+
assert_eq!(parse("1.2.3-alpha1+42"), parse("1.2.3-alpha1+42"));
327323
}
328324
329325
#[test]
@@ -332,6 +328,7 @@ fn test_ne() {
332328
assert!(parse("0.0.0") != parse("0.1.0"));
333329
assert!(parse("0.0.0") != parse("1.0.0"));
334330
assert!(parse("1.2.3-alpha") != parse("1.2.3-beta"));
331+
assert!(parse("1.2.3+23") != parse("1.2.3+42"));
335332
}
336333
337334
#[test]
@@ -342,6 +339,7 @@ fn test_lt() {
342339
assert!(parse("1.2.3-alpha1") < parse("1.2.3"));
343340
assert!(parse("1.2.3-alpha1") < parse("1.2.3-alpha2"));
344341
assert!(!(parse("1.2.3-alpha2") < parse("1.2.3-alpha2")));
342+
assert!(!(parse("1.2.3+23") < parse("1.2.3+42")));
345343
}
346344
347345
#[test]
@@ -351,6 +349,7 @@ fn test_le() {
351349
assert!(parse("1.2.0") <= parse("1.2.3-alpha2"));
352350
assert!(parse("1.2.3-alpha1") <= parse("1.2.3-alpha2"));
353351
assert!(parse("1.2.3-alpha2") <= parse("1.2.3-alpha2"));
352+
assert!(parse("1.2.3+23") <= parse("1.2.3+42"));
354353
}
355354
356355
#[test]
@@ -361,6 +360,7 @@ fn test_gt() {
361360
assert!(parse("1.2.3-alpha2") > parse("1.2.3-alpha1"));
362361
assert!(parse("1.2.3") > parse("1.2.3-alpha2"));
363362
assert!(!(parse("1.2.3-alpha2") > parse("1.2.3-alpha2")));
363+
assert!(!(parse("1.2.3+23") > parse("1.2.3+42")));
364364
}
365365
366366
#[test]
@@ -370,22 +370,20 @@ fn test_ge() {
370370
assert!(parse("1.2.3-alpha2") >= parse("1.2.0"));
371371
assert!(parse("1.2.3-alpha2") >= parse("1.2.3-alpha1"));
372372
assert!(parse("1.2.3-alpha2") >= parse("1.2.3-alpha2"));
373+
assert!(parse("1.2.3+23") >= parse("1.2.3+42"));
373374
}
374375
375376
#[test]
376377
fn test_spec_order() {
377378
378379
let vs = ["1.0.0-alpha",
379380
"1.0.0-alpha.1",
381+
"1.0.0-alpha.beta",
382+
"1.0.0-beta",
380383
"1.0.0-beta.2",
381384
"1.0.0-beta.11",
382385
"1.0.0-rc.1",
383-
"1.0.0-rc.1+build.1",
384-
"1.0.0",
385-
"1.0.0+0.3.7",
386-
"1.3.7+build",
387-
"1.3.7+build.2.b8f12d7",
388-
"1.3.7+build.11.e0f985a"];
386+
"1.0.0"];
389387
let mut i = 1;
390388
while i < vs.len() {
391389
let a = parse(vs[i-1]).get();

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

Lines changed: 36 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -63,34 +63,33 @@ pub enum LangItem {
6363
FailFnLangItem, // 24
6464
FailBoundsCheckFnLangItem, // 25
6565
ExchangeMallocFnLangItem, // 26
66-
VectorExchangeMallocFnLangItem, // 27
67-
ClosureExchangeMallocFnLangItem, // 28
68-
ExchangeFreeFnLangItem, // 29
69-
MallocFnLangItem, // 30
70-
FreeFnLangItem, // 31
71-
BorrowAsImmFnLangItem, // 32
72-
BorrowAsMutFnLangItem, // 33
73-
ReturnToMutFnLangItem, // 34
74-
CheckNotBorrowedFnLangItem, // 35
75-
StrDupUniqFnLangItem, // 36
76-
RecordBorrowFnLangItem, // 37
77-
UnrecordBorrowFnLangItem, // 38
78-
79-
StartFnLangItem, // 39
80-
81-
TyDescStructLangItem, // 40
82-
TyVisitorTraitLangItem, // 41
83-
OpaqueStructLangItem, // 42
66+
ClosureExchangeMallocFnLangItem, // 27
67+
ExchangeFreeFnLangItem, // 28
68+
MallocFnLangItem, // 29
69+
FreeFnLangItem, // 30
70+
BorrowAsImmFnLangItem, // 31
71+
BorrowAsMutFnLangItem, // 32
72+
ReturnToMutFnLangItem, // 33
73+
CheckNotBorrowedFnLangItem, // 34
74+
StrDupUniqFnLangItem, // 35
75+
RecordBorrowFnLangItem, // 36
76+
UnrecordBorrowFnLangItem, // 37
77+
78+
StartFnLangItem, // 38
79+
80+
TyDescStructLangItem, // 39
81+
TyVisitorTraitLangItem, // 40
82+
OpaqueStructLangItem, // 41
8483
}
8584

8685
pub struct LanguageItems {
87-
items: [Option<def_id>, ..43]
86+
items: [Option<def_id>, ..42]
8887
}
8988

9089
impl LanguageItems {
9190
pub fn new() -> LanguageItems {
9291
LanguageItems {
93-
items: [ None, ..43 ]
92+
items: [ None, ..42 ]
9493
}
9594
}
9695

@@ -130,24 +129,23 @@ impl LanguageItems {
130129
24 => "fail_",
131130
25 => "fail_bounds_check",
132131
26 => "exchange_malloc",
133-
27 => "vector_exchange_malloc",
134-
28 => "closure_exchange_malloc",
135-
29 => "exchange_free",
136-
30 => "malloc",
137-
31 => "free",
138-
32 => "borrow_as_imm",
139-
33 => "borrow_as_mut",
140-
34 => "return_to_mut",
141-
35 => "check_not_borrowed",
142-
36 => "strdup_uniq",
143-
37 => "record_borrow",
144-
38 => "unrecord_borrow",
145-
146-
39 => "start",
147-
148-
40 => "ty_desc",
149-
41 => "ty_visitor",
150-
42 => "opaque",
132+
27 => "closure_exchange_malloc",
133+
28 => "exchange_free",
134+
29 => "malloc",
135+
30 => "free",
136+
31 => "borrow_as_imm",
137+
32 => "borrow_as_mut",
138+
33 => "return_to_mut",
139+
34 => "check_not_borrowed",
140+
35 => "strdup_uniq",
141+
36 => "record_borrow",
142+
37 => "unrecord_borrow",
143+
144+
38 => "start",
145+
146+
39 => "ty_desc",
147+
40 => "ty_visitor",
148+
41 => "opaque",
151149

152150
_ => "???"
153151
}
@@ -240,9 +238,6 @@ impl LanguageItems {
240238
pub fn exchange_malloc_fn(&self) -> def_id {
241239
self.items[ExchangeMallocFnLangItem as uint].get()
242240
}
243-
pub fn vector_exchange_malloc_fn(&self) -> def_id {
244-
self.items[VectorExchangeMallocFnLangItem as uint].get()
245-
}
246241
pub fn closure_exchange_malloc_fn(&self) -> def_id {
247242
self.items[ClosureExchangeMallocFnLangItem as uint].get()
248243
}
@@ -336,7 +331,6 @@ impl<'self> LanguageItemCollector<'self> {
336331
item_refs.insert(@"fail_bounds_check",
337332
FailBoundsCheckFnLangItem as uint);
338333
item_refs.insert(@"exchange_malloc", ExchangeMallocFnLangItem as uint);
339-
item_refs.insert(@"vector_exchange_malloc", VectorExchangeMallocFnLangItem as uint);
340334
item_refs.insert(@"closure_exchange_malloc", ClosureExchangeMallocFnLangItem as uint);
341335
item_refs.insert(@"exchange_free", ExchangeFreeFnLangItem as uint);
342336
item_refs.insert(@"malloc", MallocFnLangItem as uint);

branches/auto/src/librustc/middle/trans/base.rs

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -294,25 +294,6 @@ pub fn malloc_raw_dyn(bcx: block,
294294
[size],
295295
None);
296296
rslt(r.bcx, PointerCast(r.bcx, r.val, llty_value.ptr_to()))
297-
} else if heap == heap_exchange_vector {
298-
// Grab the TypeRef type of box_ptr_ty.
299-
let element_type = match ty::get(t).sty {
300-
ty::ty_unboxed_vec(e) => e,
301-
_ => fail!("not a vector body")
302-
};
303-
let box_ptr_ty = ty::mk_evec(bcx.tcx(), element_type, ty::vstore_uniq);
304-
let llty = type_of(ccx, box_ptr_ty);
305-
306-
let llty_value = type_of::type_of(ccx, t);
307-
let llalign = llalign_of_min(ccx, llty_value);
308-
309-
// Allocate space:
310-
let r = callee::trans_lang_call(
311-
bcx,
312-
bcx.tcx().lang_items.vector_exchange_malloc_fn(),
313-
[C_i32(llalign as i32), size],
314-
None);
315-
rslt(r.bcx, PointerCast(r.bcx, r.val, llty))
316297
} else {
317298
// we treat ~fn, @fn and @[] as @ here, which isn't ideal
318299
let (mk_fn, langcall) = match heap {
@@ -322,7 +303,7 @@ pub fn malloc_raw_dyn(bcx: block,
322303
heap_exchange_closure => {
323304
(ty::mk_imm_box, bcx.tcx().lang_items.closure_exchange_malloc_fn())
324305
}
325-
_ => fail!("heap_exchange/heap_exchange_vector already handled")
306+
_ => fail!("heap_exchange already handled")
326307
};
327308

328309
// Grab the TypeRef type of box_ptr_ty.

branches/auto/src/librustc/middle/trans/common.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,6 @@ pub enum heap {
283283
heap_managed,
284284
heap_managed_unique,
285285
heap_exchange,
286-
heap_exchange_vector,
287286
heap_exchange_closure
288287
}
289288

@@ -405,7 +404,7 @@ pub fn add_clean_free(cx: block, ptr: ValueRef, heap: heap) {
405404
let f: @fn(block) -> block = |a| glue::trans_free(a, ptr);
406405
f
407406
}
408-
heap_exchange | heap_exchange_vector | heap_exchange_closure => {
407+
heap_exchange | heap_exchange_closure => {
409408
let f: @fn(block) -> block = |a| glue::trans_exchange_free(a, ptr);
410409
f
411410
}

branches/auto/src/librustc/middle/trans/expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ fn trans_rvalue_datum_unadjusted(bcx: block, expr: @ast::expr) -> DatumBlock {
460460
expr, contents);
461461
}
462462
ast::expr_vstore(contents, ast::expr_vstore_uniq) => {
463-
let heap = tvec::heap_for_unique_vector(bcx, expr_ty(bcx, contents));
463+
let heap = heap_for_unique(bcx, expr_ty(bcx, contents));
464464
return tvec::trans_uniq_or_managed_vstore(bcx, heap,
465465
expr, contents);
466466
}

branches/auto/src/librustc/middle/trans/glue.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -397,9 +397,7 @@ pub fn make_free_glue(bcx: block, v: ValueRef, t: ty::t) -> block {
397397
ty::ty_uniq(*) => {
398398
uniq::make_free_glue(bcx, v, t)
399399
}
400-
ty::ty_evec(_, ty::vstore_uniq) | ty::ty_estr(ty::vstore_uniq) => {
401-
tvec::make_uniq_free_glue(bcx, v, t)
402-
}
400+
ty::ty_evec(_, ty::vstore_uniq) | ty::ty_estr(ty::vstore_uniq) |
403401
ty::ty_evec(_, ty::vstore_box) | ty::ty_estr(ty::vstore_box) => {
404402
make_free_glue(bcx, v, tvec::expand_boxed_vec_ty(bcx.tcx(), t))
405403
}

branches/auto/src/librustc/middle/trans/reflect.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,9 @@ impl Reflector {
122122
bracket_name: &str,
123123
extra: &[ValueRef],
124124
inner: &fn(&mut Reflector)) {
125-
self.visit(~"enter_" + bracket_name, extra);
125+
self.visit("enter_" + bracket_name, extra);
126126
inner(self);
127-
self.visit(~"leave_" + bracket_name, extra);
127+
self.visit("leave_" + bracket_name, extra);
128128
}
129129

130130
pub fn vstore_name_and_extra(&mut self,
@@ -183,7 +183,11 @@ impl Reflector {
183183
ty::ty_evec(ref mt, vst) => {
184184
let (name, extra) = self.vstore_name_and_extra(t, vst);
185185
let extra = extra + self.c_mt(mt);
186-
self.visit(~"evec_" + name, extra)
186+
if "uniq" == name && ty::type_contents(bcx.tcx(), t).contains_managed() {
187+
self.visit("evec_uniq_managed", extra)
188+
} else {
189+
self.visit(~"evec_" + name, extra)
190+
}
187191
}
188192
ty::ty_box(ref mt) => {
189193
let extra = self.c_mt(mt);

0 commit comments

Comments
 (0)