Skip to content

Commit 6a14935

Browse files
committed
---
yaml --- r: 147414 b: refs/heads/try2 c: 9e00272 h: refs/heads/master v: v3
1 parent a995921 commit 6a14935

File tree

7 files changed

+91
-122
lines changed

7 files changed

+91
-122
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: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 66e3fbebd9b2c7061c139e601e73067e4b3feb5b
8+
refs/heads/try2: 9e00272441e0a17fed015f9112921f0815f9ec6c
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/Makefile.in

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -657,11 +657,6 @@ ifneq ($(strip $(findstring snap,$(MAKECMDGOALS)) \
657657
include $(CFG_SRC_DIR)mk/snap.mk
658658
endif
659659

660-
ifneq ($(findstring reformat,$(MAKECMDGOALS)),)
661-
CFG_INFO := $(info cfg: including reformat rules)
662-
include $(CFG_SRC_DIR)mk/pp.mk
663-
endif
664-
665660
ifneq ($(strip $(findstring check,$(MAKECMDGOALS)) \
666661
$(findstring test,$(MAKECMDGOALS)) \
667662
$(findstring perf,$(MAKECMDGOALS)) \

branches/try2/mk/pp.mk

Lines changed: 0 additions & 39 deletions
This file was deleted.

branches/try2/src/libextra/terminfo/parser/compiled.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ pub fn parse(file: &mut io::Reader,
320320
pub fn msys_terminfo() -> ~TermInfo {
321321
let mut strings = HashMap::new();
322322
strings.insert(~"sgr0", bytes!("\x1b[0m").to_owned());
323-
strings.insert(~"bold", bytes!("\x1b[1m;").to_owned());
323+
strings.insert(~"bold", bytes!("\x1b[1m").to_owned());
324324
strings.insert(~"setaf", bytes!("\x1b[3%p1%dm").to_owned());
325325
strings.insert(~"setab", bytes!("\x1b[4%p1%dm").to_owned());
326326
~TermInfo {

branches/try2/src/libstd/local_data.rs

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -353,56 +353,56 @@ mod tests {
353353

354354
#[test]
355355
fn test_tls_multitask() {
356-
static my_key: Key<@~str> = &Key;
357-
set(my_key, @~"parent data");
356+
static my_key: Key<~str> = &Key;
357+
set(my_key, ~"parent data");
358358
do task::spawn {
359359
// TLS shouldn't carry over.
360-
assert!(get(my_key, |k| k.map(|k| *k)).is_none());
361-
set(my_key, @~"child data");
362-
assert!(*(get(my_key, |k| k.map(|k| *k)).unwrap()) ==
360+
assert!(get(my_key, |k| k.map(|k| (*k).clone())).is_none());
361+
set(my_key, ~"child data");
362+
assert!(get(my_key, |k| k.map(|k| (*k).clone())).unwrap() ==
363363
~"child data");
364364
// should be cleaned up for us
365365
}
366366
// Must work multiple times
367-
assert!(*(get(my_key, |k| k.map(|k| *k)).unwrap()) == ~"parent data");
368-
assert!(*(get(my_key, |k| k.map(|k| *k)).unwrap()) == ~"parent data");
369-
assert!(*(get(my_key, |k| k.map(|k| *k)).unwrap()) == ~"parent data");
367+
assert!(get(my_key, |k| k.map(|k| (*k).clone())).unwrap() == ~"parent data");
368+
assert!(get(my_key, |k| k.map(|k| (*k).clone())).unwrap() == ~"parent data");
369+
assert!(get(my_key, |k| k.map(|k| (*k).clone())).unwrap() == ~"parent data");
370370
}
371371
372372
#[test]
373373
fn test_tls_overwrite() {
374-
static my_key: Key<@~str> = &Key;
375-
set(my_key, @~"first data");
376-
set(my_key, @~"next data"); // Shouldn't leak.
377-
assert!(*(get(my_key, |k| k.map(|k| *k)).unwrap()) == ~"next data");
374+
static my_key: Key<~str> = &Key;
375+
set(my_key, ~"first data");
376+
set(my_key, ~"next data"); // Shouldn't leak.
377+
assert!(get(my_key, |k| k.map(|k| (*k).clone())).unwrap() == ~"next data");
378378
}
379379
380380
#[test]
381381
fn test_tls_pop() {
382-
static my_key: Key<@~str> = &Key;
383-
set(my_key, @~"weasel");
384-
assert!(*(pop(my_key).unwrap()) == ~"weasel");
382+
static my_key: Key<~str> = &Key;
383+
set(my_key, ~"weasel");
384+
assert!(pop(my_key).unwrap() == ~"weasel");
385385
// Pop must remove the data from the map.
386386
assert!(pop(my_key).is_none());
387387
}
388388
389389
#[test]
390390
fn test_tls_modify() {
391-
static my_key: Key<@~str> = &Key;
391+
static my_key: Key<~str> = &Key;
392392
modify(my_key, |data| {
393393
match data {
394-
Some(@ref val) => fail!("unwelcome value: {}", *val),
395-
None => Some(@~"first data")
394+
Some(ref val) => fail!("unwelcome value: {}", *val),
395+
None => Some(~"first data")
396396
}
397397
});
398398
modify(my_key, |data| {
399399
match data {
400-
Some(@~"first data") => Some(@~"next data"),
401-
Some(@ref val) => fail!("wrong value: {}", *val),
400+
Some(~"first data") => Some(~"next data"),
401+
Some(ref val) => fail!("wrong value: {}", *val),
402402
None => fail!("missing value")
403403
}
404404
});
405-
assert!(*(pop(my_key).unwrap()) == ~"next data");
405+
assert!(pop(my_key).unwrap() == ~"next data");
406406
}
407407
408408
#[test]
@@ -413,67 +413,67 @@ mod tests {
413413
// to get recorded as something within a rust stack segment. Then a
414414
// subsequent upcall (esp. for logging, think vsnprintf) would run on
415415
// a stack smaller than 1 MB.
416-
static my_key: Key<@~str> = &Key;
416+
static my_key: Key<~str> = &Key;
417417
do task::spawn {
418-
set(my_key, @~"hax");
418+
set(my_key, ~"hax");
419419
}
420420
}
421421
422422
#[test]
423423
fn test_tls_multiple_types() {
424-
static str_key: Key<@~str> = &Key;
425-
static box_key: Key<@@()> = &Key;
426-
static int_key: Key<@int> = &Key;
424+
static str_key: Key<~str> = &Key;
425+
static box_key: Key<@()> = &Key;
426+
static int_key: Key<int> = &Key;
427427
do task::spawn {
428-
set(str_key, @~"string data");
429-
set(box_key, @@());
430-
set(int_key, @42);
428+
set(str_key, ~"string data");
429+
set(box_key, @());
430+
set(int_key, 42);
431431
}
432432
}
433433
434434
#[test]
435435
fn test_tls_overwrite_multiple_types() {
436-
static str_key: Key<@~str> = &Key;
437-
static box_key: Key<@@()> = &Key;
438-
static int_key: Key<@int> = &Key;
436+
static str_key: Key<~str> = &Key;
437+
static box_key: Key<@()> = &Key;
438+
static int_key: Key<int> = &Key;
439439
do task::spawn {
440-
set(str_key, @~"string data");
441-
set(str_key, @~"string data 2");
442-
set(box_key, @@());
443-
set(box_key, @@());
444-
set(int_key, @42);
440+
set(str_key, ~"string data");
441+
set(str_key, ~"string data 2");
442+
set(box_key, @());
443+
set(box_key, @());
444+
set(int_key, 42);
445445
// This could cause a segfault if overwriting-destruction is done
446446
// with the crazy polymorphic transmute rather than the provided
447447
// finaliser.
448-
set(int_key, @31337);
448+
set(int_key, 31337);
449449
}
450450
}
451451
452452
#[test]
453453
#[should_fail]
454454
fn test_tls_cleanup_on_failure() {
455-
static str_key: Key<@~str> = &Key;
456-
static box_key: Key<@@()> = &Key;
457-
static int_key: Key<@int> = &Key;
458-
set(str_key, @~"parent data");
459-
set(box_key, @@());
455+
static str_key: Key<~str> = &Key;
456+
static box_key: Key<@()> = &Key;
457+
static int_key: Key<int> = &Key;
458+
set(str_key, ~"parent data");
459+
set(box_key, @());
460460
do task::spawn {
461461
// spawn_linked
462-
set(str_key, @~"string data");
463-
set(box_key, @@());
464-
set(int_key, @42);
462+
set(str_key, ~"string data");
463+
set(box_key, @());
464+
set(int_key, 42);
465465
fail!();
466466
}
467467
// Not quite nondeterministic.
468-
set(int_key, @31337);
468+
set(int_key, 31337);
469469
fail!();
470470
}
471471

472472
#[test]
473473
fn test_static_pointer() {
474-
static key: Key<@&'static int> = &Key;
474+
static key: Key<&'static int> = &Key;
475475
static VALUE: int = 0;
476-
let v: @&'static int = @&VALUE;
476+
let v: &'static int = &VALUE;
477477
set(key, v);
478478
}
479479

branches/try2/src/libstd/option.rs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -445,28 +445,34 @@ mod tests {
445445

446446
#[test]
447447
fn test_get_resource() {
448+
use rc::Rc;
449+
use cell::RefCell;
450+
448451
struct R {
449-
i: @mut int,
452+
i: Rc<RefCell<int>>,
450453
}
451454

452455
#[unsafe_destructor]
453456
impl ::ops::Drop for R {
454-
fn drop(&mut self) { *(self.i) += 1; }
457+
fn drop(&mut self) {
458+
let ii = self.i.borrow();
459+
ii.set(ii.get() + 1);
460+
}
455461
}
456462

457-
fn R(i: @mut int) -> R {
463+
fn R(i: Rc<RefCell<int>>) -> R {
458464
R {
459465
i: i
460466
}
461467
}
462468

463-
let i = @mut 0;
469+
let i = Rc::from_send(RefCell::new(0));
464470
{
465-
let x = R(i);
471+
let x = R(i.clone());
466472
let opt = Some(x);
467473
let _y = opt.unwrap();
468474
}
469-
assert_eq!(*i, 1);
475+
assert_eq!(i.borrow().get(), 1);
470476
}
471477

472478
#[test]

0 commit comments

Comments
 (0)