Skip to content

Commit 63d6397

Browse files
committed
---
yaml --- r: 52458 b: refs/heads/dist-snap c: b7ef28c h: refs/heads/master v: v3
1 parent 48907c7 commit 63d6397

Some content is hidden

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

44 files changed

+84
-109
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
99
refs/heads/incoming: 44d4d6de762f3f9aae1fedcf454c66b79b3ad58d
10-
refs/heads/dist-snap: 778aec998b0a4a34632b22abd8c1cfa599fe78f0
10+
refs/heads/dist-snap: b7ef28c33abff6bcaf353a3958e497e15ee3268d
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1313
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/AUTHORS.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ Benjamin Jackman <[email protected]>
2626
Benjamin Kircher <[email protected]>
2727
Benjamin Peterson <[email protected]>
2828
Bilal Husain <[email protected]>
29-
Bill Fallon <[email protected]>
3029
Brendan Eich <[email protected]>
3130
Brian Anderson <[email protected]>
3231
Brian J. Burg <[email protected]>

branches/dist-snap/doc/rust.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3018,11 +3018,6 @@ Local variables are immutable unless declared with `let mut`. The
30183018
declaration (so `let mut x, y` declares two mutable variables, `x` and
30193019
`y`).
30203020

3021-
Function parameters are immutable unless declared with `mut`. The
3022-
`mut` keyword applies only to the following parameter (so `|mut x, y|`
3023-
and `fn f(mut x: ~int, y: ~int)` declare one mutable variable `x` and
3024-
one immutable variable `y`).
3025-
30263021
Local variables are not initialized when allocated; the entire frame worth of
30273022
local variables are allocated at once, on frame-entry, in an uninitialized
30283023
state. Subsequent statements within a function may or may not initialize the

branches/dist-snap/src/compiletest/runtest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ fn check_expected_errors(expected_errors: ~[errors::expected_error],
273273
procres: procres) {
274274

275275
// true if we found the error in question
276-
let found_flags = vec::cast_to_mut(vec::from_elem(
276+
let found_flags = vec::to_mut(vec::from_elem(
277277
vec::len(expected_errors), false));
278278

279279
if procres.status == 0 {

branches/dist-snap/src/libcargo/cargo.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ use core::*;
5252
use core::dvec::DVec;
5353
use core::io::WriterUtil;
5454
use core::result::{Ok, Err};
55-
use core::send_map::linear::LinearMap;
55+
use core::hashmap::linear::LinearMap;
5656
use std::getopts::{optflag, optopt, opt_present};
5757
use std::map::HashMap;
5858
use std::{map, json, tempfile, term, sort, getopts};

branches/dist-snap/src/libcore/core.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ pub mod dvec_iter;
138138
pub mod dlist;
139139
#[path="iter-trait.rs"] #[merge = "iter-trait/dlist.rs"]
140140
pub mod dlist_iter;
141-
pub mod send_map;
141+
pub mod hashmap;
142142

143143

144144
/* Tasks and communication */

branches/dist-snap/src/libcore/dvec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ impl<A> DVec<A> {
145145
#[inline(always)]
146146
fn swap_mut(f: &fn(v: ~[mut A]) -> ~[mut A]) {
147147
do self.swap |v| {
148-
vec::cast_from_mut(f(vec::cast_to_mut(move v)))
148+
vec::from_mut(f(vec::to_mut(move v)))
149149
}
150150
}
151151

branches/dist-snap/src/libcore/gc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ use io;
4444
use libc::{size_t, uintptr_t};
4545
use option::{None, Option, Some};
4646
use ptr;
47-
use send_map::linear::LinearSet;
47+
use hashmap::linear::LinearSet;
4848
use stackwalk;
4949
use sys;
5050

branches/dist-snap/src/libcore/send_map.rs renamed to branches/dist-snap/src/libcore/hashmap.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,8 +494,8 @@ pub mod linear {
494494
#[test]
495495
pub mod test {
496496
use option::{None, Some};
497-
use send_map::linear::LinearMap;
498-
use send_map::linear;
497+
use hashmap::linear::LinearMap;
498+
use hashmap::linear;
499499
use uint;
500500

501501
#[test]

branches/dist-snap/src/libcore/os.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ pub fn as_c_charp<T>(s: &str, f: fn(*c_char) -> T) -> T {
8484

8585
pub fn fill_charp_buf(f: fn(*mut c_char, size_t) -> bool)
8686
-> Option<~str> {
87-
let buf = vec::cast_to_mut(vec::from_elem(tmpbuf_sz, 0u8 as c_char));
87+
let buf = vec::to_mut(vec::from_elem(tmpbuf_sz, 0u8 as c_char));
8888
do vec::as_mut_buf(buf) |b, sz| {
8989
if f(b, sz as size_t) unsafe {
9090
Some(str::raw::from_buf(b as *u8))
@@ -111,7 +111,7 @@ pub mod win32 {
111111
let mut res = None;
112112
let mut done = false;
113113
while !done {
114-
let buf = vec::cast_to_mut(vec::from_elem(n as uint, 0u16));
114+
let buf = vec::to_mut(vec::from_elem(n as uint, 0u16));
115115
do vec::as_mut_buf(buf) |b, _sz| {
116116
let k : DWORD = f(b, tmpbuf_sz as DWORD);
117117
if k == (0 as DWORD) {
@@ -1269,7 +1269,7 @@ mod tests {
12691269
};
12701270
assert (ostream as uint != 0u);
12711271
let s = ~"hello";
1272-
let mut buf = vec::cast_to_mut(str::to_bytes(s) + ~[0 as u8]);
1272+
let mut buf = vec::to_mut(str::to_bytes(s) + ~[0 as u8]);
12731273
do vec::as_mut_buf(buf) |b, _len| {
12741274
assert (libc::fwrite(b as *c_void, 1u as size_t,
12751275
(str::len(s) + 1u) as size_t, ostream)

branches/dist-snap/src/libcore/task/spawn.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ use pipes;
8181
use prelude::*;
8282
use private;
8383
use ptr;
84-
use send_map;
84+
use hashmap::linear::LinearSet;
8585
use task::local_data_priv::{local_get, local_set};
8686
use task::rt::rust_task;
8787
use task::rt::rust_closure;
@@ -96,10 +96,10 @@ macro_rules! move_it (
9696
{ $x:expr } => ( unsafe { let y = move *ptr::addr_of(&($x)); move y } )
9797
)
9898

99-
type TaskSet = send_map::linear::LinearSet<*rust_task>;
99+
type TaskSet = LinearSet<*rust_task>;
100100

101101
fn new_taskset() -> TaskSet {
102-
send_map::linear::LinearSet::new()
102+
LinearSet::new()
103103
}
104104
fn taskset_insert(tasks: &mut TaskSet, task: *rust_task) {
105105
let didnt_overwrite = tasks.insert(task);

branches/dist-snap/src/libcore/vec.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -209,12 +209,12 @@ pub pure fn build_sized_opt<A>(size: Option<uint>,
209209
}
210210

211211
/// Produces a mut vector from an immutable vector.
212-
pub pure fn cast_to_mut<T>(v: ~[T]) -> ~[mut T] {
212+
pub pure fn to_mut<T>(v: ~[T]) -> ~[mut T] {
213213
unsafe { ::cast::transmute(v) }
214214
}
215215

216216
/// Produces an immutable vector from a mut vector.
217-
pub pure fn cast_from_mut<T>(v: ~[mut T]) -> ~[T] {
217+
pub pure fn from_mut<T>(v: ~[mut T]) -> ~[T] {
218218
unsafe { ::cast::transmute(v) }
219219
}
220220

@@ -552,7 +552,7 @@ pub fn consume<T>(v: ~[T], f: fn(uint, v: T)) unsafe {
552552
}
553553

554554
pub fn consume_mut<T>(v: ~[mut T], f: fn(uint, v: T)) {
555-
consume(vec::cast_from_mut(v), f)
555+
consume(vec::from_mut(v), f)
556556
}
557557

558558
/// Remove the last element from a vector and return it
@@ -718,7 +718,7 @@ pub pure fn append_one<T>(lhs: ~[T], x: T) -> ~[T] {
718718

719719
#[inline(always)]
720720
pub pure fn append_mut<T: Copy>(lhs: ~[mut T], rhs: &[const T]) -> ~[mut T] {
721-
cast_to_mut(append(cast_from_mut(lhs), rhs))
721+
to_mut(append(from_mut(lhs), rhs))
722722
}
723723

724724
/**
@@ -3271,22 +3271,22 @@ mod tests {
32713271
}
32723272

32733273
#[test]
3274-
fn cast_to_mut_no_copy() {
3274+
fn to_mut_no_copy() {
32753275
unsafe {
32763276
let x = ~[1, 2, 3];
32773277
let addr = raw::to_ptr(x);
3278-
let x_mut = cast_to_mut(x);
3278+
let x_mut = to_mut(x);
32793279
let addr_mut = raw::to_ptr(x_mut);
32803280
assert addr == addr_mut;
32813281
}
32823282
}
32833283

32843284
#[test]
3285-
fn cast_from_mut_no_copy() {
3285+
fn from_mut_no_copy() {
32863286
unsafe {
32873287
let x = ~[mut 1, 2, 3];
32883288
let addr = raw::to_ptr(x);
3289-
let x_imm = cast_from_mut(x);
3289+
let x_imm = from_mut(x);
32903290
let addr_imm = raw::to_ptr(x_imm);
32913291
assert addr == addr_imm;
32923292
}

branches/dist-snap/src/librustc/middle/borrowck/gather_loans.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ use util::common::indenter;
3030
use util::ppaux::{expr_repr, region_to_str};
3131

3232
use core::dvec;
33-
use core::send_map::linear::LinearSet;
33+
use core::hashmap::linear::LinearSet;
3434
use core::vec;
3535
use std::map::HashMap;
3636
use syntax::ast::{m_const, m_imm, m_mutbl};

branches/dist-snap/src/librustc/middle/liveness.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -661,11 +661,11 @@ fn Liveness(ir: @IrMaps, specials: Specials) -> Liveness {
661661
tcx: ir.tcx,
662662
s: specials,
663663
successors:
664-
vec::cast_to_mut(
664+
vec::to_mut(
665665
vec::from_elem(ir.num_live_nodes,
666666
invalid_node())),
667667
users:
668-
vec::cast_to_mut(
668+
vec::to_mut(
669669
vec::from_elem(ir.num_live_nodes * ir.num_vars,
670670
invalid_users())),
671671
loop_scope: DVec(),

branches/dist-snap/src/librustc/middle/trans/_match.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -985,7 +985,7 @@ fn pick_col(m: &[@Match]) -> uint {
985985
_ => 0u
986986
}
987987
}
988-
let scores = vec::cast_to_mut(vec::from_elem(m[0].pats.len(), 0u));
988+
let scores = vec::to_mut(vec::from_elem(m[0].pats.len(), 0u));
989989
for vec::each(m) |br| {
990990
let mut i = 0u;
991991
for vec::each(br.pats) |p| { scores[i] += score(*p); i += 1u; }

branches/dist-snap/src/librustc/middle/trans/foreign.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,14 +297,14 @@ fn classify_ty(ty: TypeRef) -> ~[x86_64_reg_class] {
297297
}
298298

299299
let words = (ty_size(ty) + 7) / 8;
300-
let cls = vec::cast_to_mut(vec::from_elem(words, no_class));
300+
let cls = vec::to_mut(vec::from_elem(words, no_class));
301301
if words > 4 {
302302
all_mem(cls);
303-
return vec::cast_from_mut(move cls);
303+
return vec::from_mut(move cls);
304304
}
305305
classify(ty, cls, 0, 0);
306306
fixup(ty, cls);
307-
return vec::cast_from_mut(move cls);
307+
return vec::from_mut(move cls);
308308
}
309309

310310
fn llreg_ty(cls: &[x86_64_reg_class]) -> TypeRef {

branches/dist-snap/src/librustc/middle/trans/type_use.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ fn type_uses_for(ccx: @crate_ctxt, fn_id: def_id, n_tps: uint)
6868
// Conservatively assume full use for recursive loops
6969
ccx.type_use_cache.insert(fn_id, vec::from_elem(n_tps, 3u));
7070

71-
let cx = {ccx: ccx, uses: vec::cast_to_mut(vec::from_elem(n_tps, 0u))};
71+
let cx = {ccx: ccx, uses: vec::to_mut(vec::from_elem(n_tps, 0u))};
7272
match ty::get(ty::lookup_item_type(cx.ccx.tcx, fn_id).ty).sty {
7373
ty::ty_fn(ref fn_ty) => {
7474
for vec::each(fn_ty.sig.inputs) |arg| {
@@ -84,7 +84,7 @@ fn type_uses_for(ccx: @crate_ctxt, fn_id: def_id, n_tps: uint)
8484
}
8585

8686
if fn_id_loc.crate != local_crate {
87-
let uses = vec::cast_from_mut(copy cx.uses);
87+
let uses = vec::from_mut(copy cx.uses);
8888
ccx.type_use_cache.insert(fn_id, copy uses);
8989
return uses;
9090
}
@@ -167,7 +167,7 @@ fn type_uses_for(ccx: @crate_ctxt, fn_id: def_id, n_tps: uint)
167167
ccx.tcx.sess.parse_sess.interner)));
168168
}
169169
}
170-
let uses = vec::cast_from_mut(copy cx.uses);
170+
let uses = vec::from_mut(copy cx.uses);
171171
// XXX: Bad copy, use @vec instead?
172172
ccx.type_use_cache.insert(fn_id, copy uses);
173173
uses

branches/dist-snap/src/librustc/middle/typeck/check/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3024,7 +3024,7 @@ fn check_bounds_are_used(ccx: @crate_ctxt,
30243024

30253025
// make a vector of booleans initially false, set to true when used
30263026
if tps.len() == 0u { return; }
3027-
let tps_used = vec::cast_to_mut(vec::from_elem(tps.len(), false));
3027+
let tps_used = vec::to_mut(vec::from_elem(tps.len(), false));
30283028

30293029
ty::walk_regions_and_ty(
30303030
ccx.tcx, ty,

branches/dist-snap/src/librustc/middle/typeck/coherence.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ use util::ppaux::ty_to_str;
5757

5858
use core::dvec::DVec;
5959
use core::result::Ok;
60-
use core::send_map;
60+
use core::hashmap::linear::LinearSet;
6161
use core::uint::range;
6262
use core::uint;
6363
use core::vec::{len, push};
@@ -693,7 +693,7 @@ impl CoherenceChecker {
693693
694694
let tcx = self.crate_context.tcx;
695695
696-
let mut provided_names = send_map::linear::LinearSet::new();
696+
let mut provided_names = LinearSet::new();
697697
// Implemented methods
698698
for uint::range(0, all_methods.len()) |i| {
699699
provided_names.insert(all_methods[i].ident);

branches/dist-snap/src/libstd/bitv.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use core::ops;
1414
use core::prelude::*;
1515
use core::uint;
16-
use core::vec::{cast_to_mut, from_elem};
16+
use core::vec::{to_mut, from_elem};
1717
use core::vec;
1818

1919
struct SmallBitv {
@@ -231,7 +231,7 @@ pub fn Bitv (nbits: uint, init: bool) -> Bitv {
231231
let nelems = nbits/uint_bits +
232232
if nbits % uint_bits == 0 {0} else {1};
233233
let elem = if init {!0} else {0};
234-
let s = cast_to_mut(from_elem(nelems, elem));
234+
let s = to_mut(from_elem(nelems, elem));
235235
Big(~BigBitv(move s))
236236
};
237237
Bitv {rep: move rep, nbits: nbits}
@@ -516,7 +516,7 @@ impl Bitv: Clone {
516516
Bitv{nbits: self.nbits, rep: Small(~SmallBitv{bits: b.bits})}
517517
}
518518
Big(ref b) => {
519-
let st = cast_to_mut(from_elem(self.nbits / uint_bits + 1, 0));
519+
let st = to_mut(from_elem(self.nbits / uint_bits + 1, 0));
520520
let len = st.len();
521521
for uint::range(0, len) |i| { st[i] = b.storage[i]; };
522522
Bitv{nbits: self.nbits, rep: Big(~BigBitv{storage: move st})}

branches/dist-snap/src/libstd/getopts.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ pub type Result = result::Result<Matches, Fail_>;
222222
pub fn getopts(args: &[~str], opts: &[Opt]) -> Result unsafe {
223223
let n_opts = opts.len();
224224
fn f(_x: uint) -> ~[Optval] { return ~[]; }
225-
let vals = vec::cast_to_mut(vec::from_fn(n_opts, f));
225+
let vals = vec::to_mut(vec::from_fn(n_opts, f));
226226
let mut free: ~[~str] = ~[];
227227
let l = args.len();
228228
let mut i = 0;
@@ -337,7 +337,7 @@ pub fn getopts(args: &[~str], opts: &[Opt]) -> Result unsafe {
337337
i += 1;
338338
}
339339
return Ok(Matches {opts: vec::from_slice(opts),
340-
vals: vec::cast_from_mut(move vals),
340+
vals: vec::from_mut(move vals),
341341
free: free});
342342
}
343343

branches/dist-snap/src/libstd/json.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use core::float;
2424
use core::io::{WriterUtil, ReaderUtil};
2525
use core::io;
2626
use core::prelude::*;
27-
use core::send_map::linear;
27+
use core::hashmap::linear;
2828
use core::str;
2929
use core::to_str;
3030
use core::vec;
@@ -1223,7 +1223,7 @@ mod tests {
12231223
use json::*;
12241224

12251225
use core::result;
1226-
use core::send_map::linear;
1226+
use core::hashmap::linear;
12271227

12281228
fn mk_object(items: &[(~str, Json)]) -> Json {
12291229
let mut d = ~linear::LinearMap();

branches/dist-snap/src/libstd/map.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use core::ops;
1919
use core::to_str::ToStr;
2020
use core::mutable::Mut;
2121
use core::prelude::*;
22-
use core::send_map::linear::LinearMap;
22+
use core::hashmap::linear::LinearMap;
2323
use core::to_bytes::IterBytes;
2424
use core::uint;
2525
use core::vec;
@@ -450,7 +450,7 @@ pub mod chained {
450450
}
451451

452452
fn chains<K,V>(nchains: uint) -> ~[mut Option<@Entry<K,V>>] {
453-
vec::cast_to_mut(vec::from_elem(nchains, None))
453+
vec::to_mut(vec::from_elem(nchains, None))
454454
}
455455

456456
pub fn mk<K:Eq IterBytes Hash, V: Copy>() -> T<K,V> {

branches/dist-snap/src/libstd/md4.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub pure fn md4(msg: &[u8]) -> {a: u32, b: u32, c: u32, d: u32} {
4747

4848
let mut i = 0u;
4949
let e = vec::len(msg);
50-
let x = vec::cast_to_mut(vec::from_elem(16u, 0u32));
50+
let x = vec::to_mut(vec::from_elem(16u, 0u32));
5151
while i < e {
5252
let aa = a, bb = b, cc = c, dd = d;
5353

0 commit comments

Comments
 (0)