Skip to content

Commit b9ee026

Browse files
committed
---
yaml --- r: 151661 b: refs/heads/try2 c: 95e310a h: refs/heads/master i: 151659: 8211f4f v: v3
1 parent 79f1908 commit b9ee026

File tree

190 files changed

+844
-773
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

190 files changed

+844
-773
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: 2a7a39191a83fc2a63df6cb47acd344ae669d9c7
8+
refs/heads/try2: 95e310abdcbfe0f5ad511258097624719cbc84db
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/test/auxiliary/cci_class_4.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub mod kitties {
1313
meows : uint,
1414

1515
pub how_hungry : int,
16-
pub name : ~str,
16+
pub name : StrBuf,
1717
}
1818

1919
impl cat {
@@ -41,7 +41,7 @@ pub mod kitties {
4141
}
4242
}
4343

44-
pub fn cat(in_x : uint, in_y : int, in_name: ~str) -> cat {
44+
pub fn cat(in_x : uint, in_y : int, in_name: StrBuf) -> cat {
4545
cat {
4646
meows: in_x,
4747
how_hungry: in_y,

branches/try2/src/test/auxiliary/cci_class_cast.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub mod kitty {
1414
pub struct cat {
1515
meows : uint,
1616
pub how_hungry : int,
17-
pub name : ~str,
17+
pub name : StrBuf,
1818
}
1919

2020
impl fmt::Show for cat {
@@ -50,7 +50,7 @@ pub mod kitty {
5050
}
5151
}
5252

53-
pub fn cat(in_x : uint, in_y : int, in_name: ~str) -> cat {
53+
pub fn cat(in_x : uint, in_y : int, in_name: StrBuf) -> cat {
5454
cat {
5555
meows: in_x,
5656
how_hungry: in_y,

branches/try2/src/test/auxiliary/crate-method-reexport-grrrrrrr2.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ pub mod name_pool {
1717
pub type name_pool = ();
1818

1919
pub trait add {
20-
fn add(&self, s: ~str);
20+
fn add(&self, s: StrBuf);
2121
}
2222

2323
impl add for name_pool {
24-
fn add(&self, _s: ~str) {
24+
fn add(&self, _s: StrBuf) {
2525
}
2626
}
2727
}

branches/try2/src/test/auxiliary/crateresolve5-1.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212

1313
#![crate_type = "lib"]
1414

15-
pub struct NameVal { pub name: ~str, pub val: int }
15+
pub struct NameVal { pub name: StrBuf, pub val: int }
1616

1717
pub fn struct_nameval() -> NameVal {
18-
NameVal { name: "crateresolve5".to_owned(), val: 10 }
18+
NameVal { name: "crateresolve5".to_strbuf(), val: 10 }
1919
}
2020

2121
pub enum e {

branches/try2/src/test/auxiliary/crateresolve5-2.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212

1313
#![crate_type = "lib"]
1414

15-
pub struct NameVal { pub name: ~str, pub val: int }
15+
pub struct NameVal { pub name: StrBuf, pub val: int }
1616
pub fn struct_nameval() -> NameVal {
17-
NameVal { name: "crateresolve5".to_owned(), val: 10 }
17+
NameVal { name: "crateresolve5".to_strbuf(), val: 10 }
1818
}
1919

2020
pub enum e {

branches/try2/src/test/auxiliary/explicit_self_xcrate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub trait Foo {
1414
}
1515

1616
pub struct Bar {
17-
pub x: ~str
17+
pub x: StrBuf
1818
}
1919

2020
impl Foo for Bar {

branches/try2/src/test/auxiliary/issue-2414-a.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ trait foo {
1717
fn foo(&self);
1818
}
1919

20-
impl foo for ~str {
20+
impl foo for StrBuf {
2121
fn foo(&self) {}
2222
}

branches/try2/src/test/auxiliary/issue-2631-a.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@ extern crate collections;
1717
use std::cell::RefCell;
1818
use collections::HashMap;
1919

20-
pub type header_map = HashMap<~str, @RefCell<Vec<@~str>>>;
20+
pub type header_map = HashMap<StrBuf, @RefCell<Vec<@StrBuf>>>;
2121

2222
// the unused ty param is necessary so this gets monomorphized
2323
pub fn request<T>(req: &header_map) {
24-
let _x = (**((**req.get(&"METHOD".to_owned())).clone()).borrow().clone().get(0)).clone();
24+
let _x = (**((**req.get(&"METHOD".to_strbuf())).clone()).borrow()
25+
.clone()
26+
.get(0)).clone();
2527
}

branches/try2/src/test/auxiliary/issue13507.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ pub mod testtypes {
4848
// Tests ty_float (does not test all variants of FloatTy)
4949
pub type FooFloat = f64;
5050

51-
// For ty_str, what kind of string should I use? &'static str? ~str? Raw str?
51+
// For ty_str, what kind of string should I use? &'static str? StrBuf? Raw str?
5252

5353
// Tests ty_enum
5454
pub enum FooEnum {

branches/try2/src/test/auxiliary/issue_2242_a.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
#![crate_type = "lib"]
1313

1414
trait to_strz {
15-
fn to_strz() -> ~str;
15+
fn to_strz() -> StrBuf;
1616
}
1717

18-
impl to_strz for ~str {
19-
fn to_strz() -> ~str { self.clone() }
18+
impl to_strz for StrBuf {
19+
fn to_strz() -> StrBuf { self.clone() }
2020
}

branches/try2/src/test/auxiliary/issue_2242_c.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ extern crate a;
1616
use a::to_strz;
1717

1818
impl to_strz for bool {
19-
fn to_strz() -> ~str { fmt!("%b", self) }
19+
fn to_strz() -> StrBuf { fmt!("%b", self) }
2020
}

branches/try2/src/test/auxiliary/reexported_static_methods.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub mod sub_foo {
3131
}
3232

3333
pub struct Boz {
34-
unused_str: ~str
34+
unused_str: StrBuf
3535
}
3636

3737
impl Boz {
@@ -46,8 +46,8 @@ pub mod sub_foo {
4646
}
4747

4848
impl Bort {
49-
pub fn bort() -> ~str {
50-
"bort()".to_owned()
49+
pub fn bort() -> StrBuf {
50+
"bort()".to_strbuf()
5151
}
5252
}
5353
}

branches/try2/src/test/auxiliary/static-methods-crate.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@
1414
use std::int;
1515

1616
pub trait read {
17-
fn readMaybe(s: ~str) -> Option<Self>;
17+
fn readMaybe(s: StrBuf) -> Option<Self>;
1818
}
1919

2020
impl read for int {
21-
fn readMaybe(s: ~str) -> Option<int> {
22-
from_str::<int>(s)
21+
fn readMaybe(s: StrBuf) -> Option<int> {
22+
from_str::<int>(s.as_slice())
2323
}
2424
}
2525

2626
impl read for bool {
27-
fn readMaybe(s: ~str) -> Option<bool> {
27+
fn readMaybe(s: StrBuf) -> Option<bool> {
2828
match s.as_slice() {
2929
"true" => Some(true),
3030
"false" => Some(false),
@@ -33,7 +33,7 @@ impl read for bool {
3333
}
3434
}
3535

36-
pub fn read<T:read>(s: ~str) -> T {
36+
pub fn read<T:read>(s: StrBuf) -> T {
3737
match read::readMaybe(s) {
3838
Some(x) => x,
3939
_ => fail!("read failed!")

branches/try2/src/test/bench/core-set.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ impl Results {
8080
}
8181
}
8282

83-
pub fn bench_str<T:MutableSet<~str>,
83+
pub fn bench_str<T:MutableSet<StrBuf>,
8484
R:rand::Rng>(
8585
&mut self,
8686
rng: &mut R,
@@ -90,11 +90,11 @@ impl Results {
9090
let mut set = f();
9191
timed(&mut self.sequential_strings, || {
9292
for i in range(0u, num_keys) {
93-
set.insert(i.to_str());
93+
set.insert(i.to_str().to_strbuf());
9494
}
9595

9696
for i in range(0u, num_keys) {
97-
assert!(set.contains(&i.to_str()));
97+
assert!(set.contains(&i.to_str().to_strbuf()));
9898
}
9999
})
100100
}
@@ -103,7 +103,7 @@ impl Results {
103103
let mut set = f();
104104
timed(&mut self.random_strings, || {
105105
for _ in range(0, num_keys) {
106-
let s = rng.gen::<uint>().to_str();
106+
let s = rng.gen::<uint>().to_str().to_strbuf();
107107
set.insert(s);
108108
}
109109
})
@@ -112,11 +112,11 @@ impl Results {
112112
{
113113
let mut set = f();
114114
for i in range(0u, num_keys) {
115-
set.insert(i.to_str());
115+
set.insert(i.to_str().to_strbuf());
116116
}
117117
timed(&mut self.delete_strings, || {
118118
for i in range(0u, num_keys) {
119-
assert!(set.remove(&i.to_str()));
119+
assert!(set.remove(&i.to_str().to_strbuf()));
120120
}
121121
})
122122
}
@@ -175,7 +175,7 @@ fn main() {
175175
s
176176
});
177177
results.bench_str(&mut rng, num_keys, || {
178-
let s: HashSet<~str> = HashSet::new();
178+
let s: HashSet<StrBuf> = HashSet::new();
179179
s
180180
});
181181
write_results("collections::HashSet", &results);
@@ -189,7 +189,7 @@ fn main() {
189189
s
190190
});
191191
results.bench_str(&mut rng, num_keys, || {
192-
let s: TreeSet<~str> = TreeSet::new();
192+
let s: TreeSet<StrBuf> = TreeSet::new();
193193
s
194194
});
195195
write_results("collections::TreeSet", &results);

branches/try2/src/test/bench/core-std.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@ use std::vec;
2424
use std::io::File;
2525

2626
macro_rules! bench (
27-
($argv:expr, $id:ident) => (maybe_run_test($argv.as_slice(), stringify!($id).to_owned(), $id))
27+
($argv:expr, $id:ident) => (maybe_run_test($argv.as_slice(),
28+
stringify!($id).to_strbuf(),
29+
$id))
2830
)
2931

3032
fn main() {
31-
let argv = os::args();
33+
let argv = os::args().move_iter().map(|x| x.to_strbuf()).collect::<Vec<StrBuf>>();
3234
let _tests = argv.slice(1, argv.len());
3335

3436
bench!(argv, shift_push);
@@ -40,13 +42,13 @@ fn main() {
4042
bench!(argv, is_utf8_multibyte);
4143
}
4244

43-
fn maybe_run_test(argv: &[~str], name: ~str, test: ||) {
45+
fn maybe_run_test(argv: &[StrBuf], name: StrBuf, test: ||) {
4446
let mut run_test = false;
4547

4648
if os::getenv("RUST_BENCH").is_some() {
4749
run_test = true
4850
} else if argv.len() > 0 {
49-
run_test = argv.iter().any(|x| x == &"all".to_owned()) || argv.iter().any(|x| x == &name)
51+
run_test = argv.iter().any(|x| x == &"all".to_strbuf()) || argv.iter().any(|x| x == &name)
5052
}
5153

5254
if !run_test {

branches/try2/src/test/bench/msgsend-pipes-shared.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ fn server(requests: &Receiver<request>, responses: &Sender<uint>) {
5252
//println!("server exiting");
5353
}
5454

55-
fn run(args: &[~str]) {
55+
fn run(args: &[StrBuf]) {
5656
let (to_parent, from_child) = channel();
5757
let (to_child, from_parent) = channel();
5858

59-
let size = from_str::<uint>(args[1]).unwrap();
60-
let workers = from_str::<uint>(args[2]).unwrap();
59+
let size = from_str::<uint>(args[1].as_slice()).unwrap();
60+
let workers = from_str::<uint>(args[2].as_slice()).unwrap();
6161
let num_bytes = 100;
6262
let start = time::precise_time_s();
6363
let mut worker_results = Vec::new();
@@ -97,13 +97,13 @@ fn run(args: &[~str]) {
9797
fn main() {
9898
let args = os::args();
9999
let args = if os::getenv("RUST_BENCH").is_some() {
100-
vec!("".to_owned(), "1000000".to_owned(), "10000".to_owned())
100+
vec!("".to_strbuf(), "1000000".to_strbuf(), "10000".to_strbuf())
101101
} else if args.len() <= 1u {
102-
vec!("".to_owned(), "10000".to_owned(), "4".to_owned())
102+
vec!("".to_strbuf(), "10000".to_strbuf(), "4".to_strbuf())
103103
} else {
104-
args.clone().move_iter().collect()
104+
args.move_iter().map(|x| x.to_strbuf()).collect()
105105
};
106106

107-
println!("{:?}", args);
107+
println!("{}", args);
108108
run(args.as_slice());
109109
}

branches/try2/src/test/bench/msgsend-pipes.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ fn server(requests: &Receiver<request>, responses: &Sender<uint>) {
4747
//println!("server exiting");
4848
}
4949

50-
fn run(args: &[~str]) {
50+
fn run(args: &[StrBuf]) {
5151
let (to_parent, from_child) = channel();
5252

53-
let size = from_str::<uint>(args[1]).unwrap();
54-
let workers = from_str::<uint>(args[2]).unwrap();
53+
let size = from_str::<uint>(args[1].as_slice()).unwrap();
54+
let workers = from_str::<uint>(args[2].as_slice()).unwrap();
5555
let num_bytes = 100;
5656
let start = time::precise_time_s();
5757
let mut worker_results = Vec::new();
@@ -107,11 +107,11 @@ fn run(args: &[~str]) {
107107
fn main() {
108108
let args = os::args();
109109
let args = if os::getenv("RUST_BENCH").is_some() {
110-
vec!("".to_owned(), "1000000".to_owned(), "8".to_owned())
110+
vec!("".to_strbuf(), "1000000".to_strbuf(), "8".to_strbuf())
111111
} else if args.len() <= 1u {
112-
vec!("".to_owned(), "10000".to_owned(), "4".to_owned())
112+
vec!("".to_strbuf(), "10000".to_strbuf(), "4".to_strbuf())
113113
} else {
114-
args.clone().move_iter().collect()
114+
args.clone().move_iter().map(|x| x.to_strbuf()).collect()
115115
};
116116

117117
println!("{:?}", args);

branches/try2/src/test/bench/shootout-binarytrees.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ fn main() {
7474
let b = bottom_up_tree(&arena, -i, depth);
7575
chk += item_check(a) + item_check(b);
7676
}
77-
format!("{}\t trees of depth {}\t check: {}",
78-
iterations * 2, depth, chk)
77+
format_strbuf!("{}\t trees of depth {}\t check: {}",
78+
iterations * 2, depth, chk)
7979
})
80-
}).collect::<Vec<Future<~str>>>();
80+
}).collect::<Vec<Future<StrBuf>>>();
8181

8282
for message in messages.mut_iter() {
8383
println!("{}", *message.get_ref());

branches/try2/src/test/bench/shootout-chameneos-redux.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ fn creature(
107107
mut color: Color,
108108
from_rendezvous: Receiver<CreatureInfo>,
109109
to_rendezvous: Sender<CreatureInfo>,
110-
to_rendezvous_log: Sender<~str>
110+
to_rendezvous_log: Sender<StrBuf>
111111
) {
112112
let mut creatures_met = 0;
113113
let mut evil_clones_met = 0;
@@ -132,7 +132,9 @@ fn creature(
132132
}
133133
}
134134
// log creatures met and evil clones of self
135-
let report = format!("{}{}", creatures_met, Number(evil_clones_met));
135+
let report = format_strbuf!("{}{}",
136+
creatures_met,
137+
Number(evil_clones_met));
136138
to_rendezvous_log.send(report);
137139
}
138140

@@ -141,7 +143,7 @@ fn rendezvous(nn: uint, set: Vec<Color>) {
141143
let (to_rendezvous, from_creatures) = channel::<CreatureInfo>();
142144

143145
// these channels will be passed to the creatures so they can talk to us
144-
let (to_rendezvous_log, from_creatures_log) = channel::<~str>();
146+
let (to_rendezvous_log, from_creatures_log) = channel::<StrBuf>();
145147

146148
// these channels will allow us to talk to each creature by 'name'/index
147149
let mut to_creature: Vec<Sender<CreatureInfo>> =

0 commit comments

Comments
 (0)