Skip to content

Commit 63bb1b6

Browse files
committed
---
yaml --- r: 106119 b: refs/heads/auto c: 8cfef59 h: refs/heads/master i: 106117: a3e902c 106115: 0aeedc2 106111: 505b57c v: v3
1 parent 28b6459 commit 63bb1b6

File tree

295 files changed

+7299
-6736
lines changed

Some content is hidden

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

295 files changed

+7299
-6736
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: 9b588a9f944719b68369c4515b4dec3c7b8ac409
16+
refs/heads/auto: 8cfef59cc0922f15979bf4e8a0b344cecfa8d9e2
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/compiletest/runtest.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ use std::io;
3232
use std::os;
3333
use std::str;
3434
use std::task;
35-
use std::vec;
35+
use std::slice;
3636

3737
use test::MetricMap;
3838

@@ -500,7 +500,7 @@ fn check_expected_errors(expected_errors: ~[errors::ExpectedError],
500500
proc_res: &ProcRes) {
501501

502502
// true if we found the error in question
503-
let mut found_flags = vec::from_elem(
503+
let mut found_flags = slice::from_elem(
504504
expected_errors.len(), false);
505505

506506
if proc_res.status.success() {

branches/auto/src/doc/guide-ffi.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ The raw C API needs to be wrapped to provide memory safety and make use of highe
7171
like vectors. A library can choose to expose only the safe, high-level interface and hide the unsafe
7272
internal details.
7373

74-
Wrapping the functions which expect buffers involves using the `vec::raw` module to manipulate Rust
74+
Wrapping the functions which expect buffers involves using the `slice::raw` module to manipulate Rust
7575
vectors as pointers to memory. Rust's vectors are guaranteed to be a contiguous block of memory. The
7676
length is number of elements currently contained, and the capacity is the total size in elements of
7777
the allocated memory. The length is less than or equal to the capacity.
@@ -103,7 +103,7 @@ pub fn compress(src: &[u8]) -> ~[u8] {
103103
let psrc = src.as_ptr();
104104
105105
let mut dstlen = snappy_max_compressed_length(srclen);
106-
let mut dst = vec::with_capacity(dstlen as uint);
106+
let mut dst = slice::with_capacity(dstlen as uint);
107107
let pdst = dst.as_mut_ptr();
108108
109109
snappy_compress(psrc, srclen, pdst, &mut dstlen);
@@ -125,7 +125,7 @@ pub fn uncompress(src: &[u8]) -> Option<~[u8]> {
125125
let mut dstlen: size_t = 0;
126126
snappy_uncompressed_length(psrc, srclen, &mut dstlen);
127127
128-
let mut dst = vec::with_capacity(dstlen as uint);
128+
let mut dst = slice::with_capacity(dstlen as uint);
129129
let pdst = dst.as_mut_ptr();
130130
131131
if snappy_uncompress(psrc, srclen, pdst, &mut dstlen) == 0 {

branches/auto/src/doc/guide-tasks.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,10 @@ might look like the example below.
255255

256256
~~~
257257
# use std::task::spawn;
258-
# use std::vec;
258+
# use std::slice;
259259
260260
// Create a vector of ports, one for each child task
261-
let rxs = vec::from_fn(3, |init_val| {
261+
let rxs = slice::from_fn(3, |init_val| {
262262
let (tx, rx) = channel();
263263
spawn(proc() {
264264
tx.send(some_expensive_computation(init_val));
@@ -304,7 +304,7 @@ be distributed on the available cores.
304304

305305
~~~
306306
# extern crate sync;
307-
# use std::vec;
307+
# use std::slice;
308308
fn partial_sum(start: uint) -> f64 {
309309
let mut local_sum = 0f64;
310310
for num in range(start*100000, (start+1)*100000) {
@@ -314,7 +314,7 @@ fn partial_sum(start: uint) -> f64 {
314314
}
315315
316316
fn main() {
317-
let mut futures = vec::from_fn(1000, |ind| sync::Future::spawn( proc() { partial_sum(ind) }));
317+
let mut futures = slice::from_fn(1000, |ind| sync::Future::spawn( proc() { partial_sum(ind) }));
318318
319319
let mut final_res = 0f64;
320320
for ft in futures.mut_iter() {
@@ -342,15 +342,15 @@ a single large vector of floats. Each task needs the full vector to perform its
342342
extern crate rand;
343343
extern crate sync;
344344
345-
use std::vec;
345+
use std::slice;
346346
use sync::Arc;
347347
348348
fn pnorm(nums: &~[f64], p: uint) -> f64 {
349349
nums.iter().fold(0.0, |a,b| a+(*b).powf(&(p as f64)) ).powf(&(1.0 / (p as f64)))
350350
}
351351
352352
fn main() {
353-
let numbers = vec::from_fn(1000000, |_| rand::random::<f64>());
353+
let numbers = slice::from_fn(1000000, |_| rand::random::<f64>());
354354
let numbers_arc = Arc::new(numbers);
355355
356356
for num in range(1u, 10) {
@@ -374,9 +374,9 @@ created by the line
374374
# extern crate sync;
375375
# extern crate rand;
376376
# use sync::Arc;
377-
# use std::vec;
377+
# use std::slice;
378378
# fn main() {
379-
# let numbers = vec::from_fn(1000000, |_| rand::random::<f64>());
379+
# let numbers = slice::from_fn(1000000, |_| rand::random::<f64>());
380380
let numbers_arc=Arc::new(numbers);
381381
# }
382382
~~~
@@ -387,9 +387,9 @@ and a clone of it is sent to each task
387387
# extern crate sync;
388388
# extern crate rand;
389389
# use sync::Arc;
390-
# use std::vec;
390+
# use std::slice;
391391
# fn main() {
392-
# let numbers=vec::from_fn(1000000, |_| rand::random::<f64>());
392+
# let numbers=slice::from_fn(1000000, |_| rand::random::<f64>());
393393
# let numbers_arc = Arc::new(numbers);
394394
# let (tx, rx) = channel();
395395
tx.send(numbers_arc.clone());
@@ -404,9 +404,9 @@ Each task recovers the underlying data by
404404
# extern crate sync;
405405
# extern crate rand;
406406
# use sync::Arc;
407-
# use std::vec;
407+
# use std::slice;
408408
# fn main() {
409-
# let numbers=vec::from_fn(1000000, |_| rand::random::<f64>());
409+
# let numbers=slice::from_fn(1000000, |_| rand::random::<f64>());
410410
# let numbers_arc=Arc::new(numbers);
411411
# let (tx, rx) = channel();
412412
# tx.send(numbers_arc.clone());

branches/auto/src/doc/guide-testing.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,18 +188,18 @@ For example:
188188
# #[allow(unused_imports)];
189189
extern crate test;
190190
191-
use std::vec;
191+
use std::slice;
192192
use test::BenchHarness;
193193
194194
#[bench]
195195
fn bench_sum_1024_ints(b: &mut BenchHarness) {
196-
let v = vec::from_fn(1024, |n| n);
196+
let v = slice::from_fn(1024, |n| n);
197197
b.iter(|| {v.iter().fold(0, |old, new| old + *new);} );
198198
}
199199
200200
#[bench]
201201
fn initialise_a_vector(b: &mut BenchHarness) {
202-
b.iter(|| {vec::from_elem(1024, 0u64);} );
202+
b.iter(|| {slice::from_elem(1024, 0u64);} );
203203
b.bytes = 1024 * 8;
204204
}
205205

branches/auto/src/doc/guide-unsafe.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -595,10 +595,10 @@ Other features provided by lang items include:
595595
- stack unwinding and general failure; the `eh_personality`, `fail_`
596596
and `fail_bounds_checks` lang items.
597597
- the traits in `std::kinds` used to indicate types that satisfy
598-
various kinds; lang items `send`, `freeze` and `pod`.
598+
various kinds; lang items `send`, `share` and `pod`.
599599
- the marker types and variance indicators found in
600600
`std::kinds::markers`; lang items `covariant_type`,
601-
`contravariant_lifetime`, `no_freeze_bound`, etc.
601+
`contravariant_lifetime`, `no_share_bound`, etc.
602602

603603
Lang items are loaded lazily by the compiler; e.g. if one never uses
604604
`~` then there is no need to define functions for `exchange_malloc`

branches/auto/src/doc/tutorial.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2095,6 +2095,10 @@ and may not be overridden:
20952095
Types are sendable
20962096
unless they contain managed boxes, managed closures, or references.
20972097
2098+
* `Share` - Types that are *threadsafe*
2099+
These are types that are safe to be used across several threads with access to
2100+
a `&T` pointer. `MutexArc` is an example of a *sharable* type with internal mutable data.
2101+
20982102
* `Freeze` - Constant (immutable) types.
20992103
These are types that do not contain anything intrinsically mutable.
21002104
Intrinsically mutable values include `Cell` in the standard library.

branches/auto/src/etc/unicode.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def emit_bsearch_range_table(f):
162162
f.write("""
163163
fn bsearch_range_table(c: char, r: &'static [(char,char)]) -> bool {
164164
use cmp::{Equal, Less, Greater};
165-
use vec::ImmutableVector;
165+
use slice::ImmutableVector;
166166
use option::None;
167167
r.bsearch(|&(lo,hi)| {
168168
if lo <= c && c <= hi { Equal }
@@ -200,7 +200,7 @@ def emit_conversions_module(f, lowerupper, upperlower):
200200
f.write("pub mod conversions {\n")
201201
f.write("""
202202
use cmp::{Equal, Less, Greater};
203-
use vec::ImmutableVector;
203+
use slice::ImmutableVector;
204204
use tuple::Tuple2;
205205
use option::{Option, Some, None};
206206
@@ -264,7 +264,7 @@ def emit_decomp_module(f, canon, compat, combine):
264264
f.write("pub mod decompose {\n");
265265
f.write(" use option::Option;\n");
266266
f.write(" use option::{Some, None};\n");
267-
f.write(" use vec::ImmutableVector;\n");
267+
f.write(" use slice::ImmutableVector;\n");
268268
f.write("""
269269
fn bsearch_table(c: char, r: &'static [(char, &'static [char])]) -> Option<&'static [char]> {
270270
use cmp::{Equal, Less, Greater};

branches/auto/src/libarena/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ use std::rc::Rc;
4242
use std::rt::global_heap;
4343
use std::intrinsics::{TyDesc, get_tydesc};
4444
use std::intrinsics;
45-
use std::vec;
45+
use std::slice;
4646

4747
// The way arena uses arrays is really deeply awful. The arrays are
4848
// allocated, and have capacities reserved, but the fill for the array
@@ -111,7 +111,7 @@ impl Arena {
111111

112112
fn chunk(size: uint, is_pod: bool) -> Chunk {
113113
Chunk {
114-
data: Rc::new(RefCell::new(vec::with_capacity(size))),
114+
data: Rc::new(RefCell::new(slice::with_capacity(size))),
115115
fill: Cell::new(0u),
116116
is_pod: Cell::new(is_pod),
117117
}

branches/auto/src/libcollections/bitv.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use std::iter::RandomAccessIterator;
1616
use std::iter::{Rev, Enumerate, Repeat, Map, Zip};
1717
use std::ops;
1818
use std::uint;
19-
use std::vec;
19+
use std::slice;
2020

2121
#[deriving(Clone)]
2222
struct SmallBitv {
@@ -278,13 +278,13 @@ impl Bitv {
278278
let s =
279279
if init {
280280
if exact {
281-
vec::from_elem(nelems, !0u)
281+
slice::from_elem(nelems, !0u)
282282
} else {
283-
let mut v = vec::from_elem(nelems-1, !0u);
283+
let mut v = slice::from_elem(nelems-1, !0u);
284284
v.push((1<<nbits % uint::BITS)-1);
285285
v
286286
}
287-
} else { vec::from_elem(nelems, 0u)};
287+
} else { slice::from_elem(nelems, 0u)};
288288
Big(BigBitv::new(s))
289289
};
290290
Bitv {rep: rep, nbits: nbits}
@@ -452,7 +452,7 @@ impl Bitv {
452452
* Each `uint` in the resulting vector has either value `0u` or `1u`.
453453
*/
454454
pub fn to_vec(&self) -> ~[uint] {
455-
vec::from_fn(self.nbits, |x| self.init_to_vec(x))
455+
slice::from_fn(self.nbits, |x| self.init_to_vec(x))
456456
}
457457

458458
/**
@@ -473,7 +473,7 @@ impl Bitv {
473473

474474
let len = self.nbits/8 +
475475
if self.nbits % 8 == 0 { 0 } else { 1 };
476-
vec::from_fn(len, |i|
476+
slice::from_fn(len, |i|
477477
bit(self, i, 0) |
478478
bit(self, i, 1) |
479479
bit(self, i, 2) |
@@ -489,7 +489,7 @@ impl Bitv {
489489
* Transform `self` into a `[bool]` by turning each bit into a `bool`.
490490
*/
491491
pub fn to_bools(&self) -> ~[bool] {
492-
vec::from_fn(self.nbits, |i| self[i])
492+
slice::from_fn(self.nbits, |i| self[i])
493493
}
494494

495495
/**
@@ -879,7 +879,7 @@ impl BitvSet {
879879
/// and w1/w2 are the words coming from the two vectors self, other.
880880
fn commons<'a>(&'a self, other: &'a BitvSet)
881881
-> Map<'static, ((uint, &'a uint), &'a ~[uint]), (uint, uint, uint),
882-
Zip<Enumerate<vec::Items<'a, uint>>, Repeat<&'a ~[uint]>>> {
882+
Zip<Enumerate<slice::Items<'a, uint>>, Repeat<&'a ~[uint]>>> {
883883
let min = cmp::min(self.bitv.storage.len(), other.bitv.storage.len());
884884
self.bitv.storage.slice(0, min).iter().enumerate()
885885
.zip(Repeat::new(&other.bitv.storage))
@@ -895,7 +895,7 @@ impl BitvSet {
895895
/// `other`.
896896
fn outliers<'a>(&'a self, other: &'a BitvSet)
897897
-> Map<'static, ((uint, &'a uint), uint), (bool, uint, uint),
898-
Zip<Enumerate<vec::Items<'a, uint>>, Repeat<uint>>> {
898+
Zip<Enumerate<slice::Items<'a, uint>>, Repeat<uint>>> {
899899
let slen = self.bitv.storage.len();
900900
let olen = other.bitv.storage.len();
901901

@@ -946,7 +946,7 @@ mod tests {
946946
use bitv;
947947

948948
use std::uint;
949-
use std::vec;
949+
use std::slice;
950950
use rand;
951951
use rand::Rng;
952952

@@ -964,7 +964,7 @@ mod tests {
964964
#[test]
965965
fn test_0_elements() {
966966
let act = Bitv::new(0u, false);
967-
let exp = vec::from_elem::<bool>(0u, false);
967+
let exp = slice::from_elem::<bool>(0u, false);
968968
assert!(act.eq_vec(exp));
969969
}
970970

branches/auto/src/libcollections/deque.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ pub mod bench {
4444
extern crate test;
4545
use self::test::BenchHarness;
4646
use std::container::MutableMap;
47-
use std::vec;
47+
use std::slice;
4848
use rand;
4949
use rand::Rng;
5050

@@ -90,7 +90,7 @@ pub mod bench {
9090
bh: &mut BenchHarness) {
9191
// setup
9292
let mut rng = rand::XorShiftRng::new();
93-
let mut keys = vec::from_fn(n, |_| rng.gen::<uint>() % n);
93+
let mut keys = slice::from_fn(n, |_| rng.gen::<uint>() % n);
9494

9595
for k in keys.iter() {
9696
map.insert(*k, 1);

branches/auto/src/libcollections/hashmap.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use std::option::{Option, Some, None};
2727
use rand;
2828
use rand::Rng;
2929
use std::result::{Ok, Err};
30-
use std::vec::{ImmutableVector};
30+
use std::slice::ImmutableVector;
3131

3232
mod table {
3333
use std::clone::Clone;
@@ -1575,7 +1575,7 @@ mod test_map {
15751575
use super::HashMap;
15761576
use std::iter::{Iterator,range_inclusive,range_step_inclusive};
15771577
use std::local_data;
1578-
use std::vec_ng;
1578+
use std::vec;
15791579

15801580
#[test]
15811581
fn test_create_capacity_zero() {
@@ -1599,7 +1599,7 @@ mod test_map {
15991599
assert_eq!(*m.find(&2).unwrap(), 4);
16001600
}
16011601

1602-
local_data_key!(drop_vector: vec_ng::Vec<int>)
1602+
local_data_key!(drop_vector: vec::Vec<int>)
16031603

16041604
#[deriving(Hash, Eq)]
16051605
struct Dropable {
@@ -1625,7 +1625,7 @@ mod test_map {
16251625

16261626
#[test]
16271627
fn test_drops() {
1628-
local_data::set(drop_vector, vec_ng::Vec::from_elem(200, 0));
1628+
local_data::set(drop_vector, vec::Vec::from_elem(200, 0));
16291629

16301630
{
16311631
let mut m = HashMap::new();
@@ -1958,7 +1958,7 @@ mod test_map {
19581958
mod test_set {
19591959
use super::HashSet;
19601960
use std::container::Container;
1961-
use std::vec::ImmutableEqVector;
1961+
use std::slice::ImmutableEqVector;
19621962

19631963
#[test]
19641964
fn test_disjoint() {

branches/auto/src/libcollections/priority_queue.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
use std::clone::Clone;
1616
use std::mem::{move_val_init, init, replace, swap};
17-
use std::vec;
17+
use std::slice;
1818

1919
/// A priority queue implemented with a binary heap
2020
#[deriving(Clone)]
@@ -181,7 +181,7 @@ impl<T:Ord> PriorityQueue<T> {
181181

182182
/// PriorityQueue iterator
183183
pub struct Items <'a, T> {
184-
priv iter: vec::Items<'a, T>,
184+
priv iter: slice::Items<'a, T>,
185185
}
186186

187187
impl<'a, T> Iterator<&'a T> for Items<'a, T> {

0 commit comments

Comments
 (0)