Skip to content

Commit cf5a455

Browse files
committed
---
yaml --- r: 42831 b: refs/heads/try c: 0336a86 h: refs/heads/master i: 42829: 8661f21 42827: 2910ee5 42823: bad9ef0 42815: b839827 v: v3
1 parent 8a0670f commit cf5a455

29 files changed

+72
-72
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 19dfec2aaf746535de1521f68421f9980dbf25de
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 2f46b763da2c098913884f101b6d71d69af41b49
5-
refs/heads/try: 3e95a1357756db52ff7e6b6376f8c6ed59925971
5+
refs/heads/try: 0336a8633f0734ef269c000c5d7432b7a706a1fe
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278

branches/try/src/libcore/dvec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ use vec;
4646
* # WARNING
4747
*
4848
* For maximum performance, this type is implemented using some rather
49-
* unsafe code. In particular, this innocent looking `~[mut A]` pointer
49+
* unsafe code. In particular, this innocent looking `~[A]` pointer
5050
* *may be null!* Therefore, it is important you not reach into the
5151
* data structure manually but instead use the provided extensions.
5252
*
@@ -143,7 +143,7 @@ impl<A> DVec<A> {
143143
* and return a new vector to replace it with.
144144
*/
145145
#[inline(always)]
146-
fn swap_mut(f: &fn(v: ~[mut A]) -> ~[mut A]) {
146+
fn swap_mut(f: &fn(v: ~[A]) -> ~[A]) {
147147
do self.swap |v| {
148148
vec::cast_from_mut(f(vec::cast_to_mut(move v)))
149149
}

branches/try/src/libcore/vec.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -206,12 +206,12 @@ pub pure fn build_sized_opt<A>(size: Option<uint>,
206206
}
207207

208208
/// Produces a mut vector from an immutable vector.
209-
pub pure fn cast_to_mut<T>(v: ~[T]) -> ~[mut T] {
209+
pub pure fn cast_to_mut<T>(v: ~[T]) -> ~[T] {
210210
unsafe { ::cast::transmute(v) }
211211
}
212212

213213
/// Produces an immutable vector from a mut vector.
214-
pub pure fn cast_from_mut<T>(v: ~[mut T]) -> ~[T] {
214+
pub pure fn cast_from_mut<T>(v: ~[T]) -> ~[T] {
215215
unsafe { ::cast::transmute(v) }
216216
}
217217

@@ -562,7 +562,7 @@ pub fn consume<T>(v: ~[T], f: fn(uint, v: T)) {
562562
}
563563
}
564564

565-
pub fn consume_mut<T>(v: ~[mut T], f: fn(uint, v: T)) {
565+
pub fn consume_mut<T>(v: ~[T], f: fn(uint, v: T)) {
566566
consume(vec::cast_from_mut(v), f)
567567
}
568568

@@ -731,7 +731,7 @@ pub pure fn append_one<T>(lhs: ~[T], x: T) -> ~[T] {
731731
}
732732

733733
#[inline(always)]
734-
pub pure fn append_mut<T: Copy>(lhs: ~[mut T], rhs: &[const T]) -> ~[mut T] {
734+
pub pure fn append_mut<T: Copy>(lhs: ~[T], rhs: &[const T]) -> ~[T] {
735735
cast_to_mut(append(cast_from_mut(lhs), rhs))
736736
}
737737

@@ -1640,9 +1640,9 @@ pub mod traits {
16401640
}
16411641
}
16421642

1643-
impl<T: Copy> ~[mut T] : Add<&[const T],~[mut T]> {
1643+
impl<T: Copy> ~[T] : Add<&[const T],~[T]> {
16441644
#[inline(always)]
1645-
pure fn add(&self, rhs: & &self/[const T]) -> ~[mut T] {
1645+
pure fn add(&self, rhs: & &self/[const T]) -> ~[T] {
16461646
append_mut(copy *self, (*rhs))
16471647
}
16481648
}

branches/try/src/libfuzzer/cycles.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ type pointy = {
4343
mut g : fn~()->(),
4444

4545
mut m : ~[maybe_pointy],
46-
mut n : ~[mut maybe_pointy],
46+
mut n : ~[maybe_pointy],
4747
mut o : {x : int, y : maybe_pointy}
4848
};
4949
// To add: objects; traits; anything type-parameterized?

branches/try/src/libfuzzer/rand_util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ fn choice<T: copy>(r : rand::rng, v : ~[T]) -> T {
2525
fn unlikely(r : rand::rng, n : uint) -> bool { under(r, n) == 0u }
2626

2727
// shuffle a vec in place
28-
fn shuffle<T>(r : rand::rng, &v : ~[mut T]) {
28+
fn shuffle<T>(r : rand::rng, &v : ~[T]) {
2929
let i = vec::len(v);
3030
while i >= 2u {
3131
// Loop invariant: elements with index >= i have been locked in place.

branches/try/src/libstd/bitv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ struct BigBitv {
109109
mut storage: ~[uint]
110110
}
111111

112-
fn BigBitv(storage: ~[mut uint]) -> BigBitv {
112+
fn BigBitv(storage: ~[uint]) -> BigBitv {
113113
BigBitv {storage: move storage}
114114
}
115115

branches/try/src/libstd/map.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ pub mod chained {
458458
}
459459
}
460460

461-
fn chains<K,V>(nchains: uint) -> ~[mut Option<@Entry<K,V>>] {
461+
fn chains<K,V>(nchains: uint) -> ~[Option<@Entry<K,V>>] {
462462
vec::cast_to_mut(vec::from_elem(nchains, None))
463463
}
464464

branches/try/src/libstd/sha1.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ const k3: u32 = 0xCA62C1D6u32;
6767
/// Construct a `sha` object
6868
pub fn sha1() -> Sha1 {
6969
type Sha1State =
70-
{h: ~[mut u32],
70+
{h: ~[u32],
7171
mut len_low: u32,
7272
mut len_high: u32,
7373
mut msg_block: ~[u8],
7474
mut msg_block_idx: uint,
7575
mut computed: bool,
76-
work_buf: @~[mut u32]};
76+
work_buf: @~[u32]};
7777

7878
fn add_input(st: &Sha1State, msg: &[const u8]) {
7979
assert (!st.computed);

branches/try/src/libstd/sort.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@ mod big_tests {
10191019
tabulate_managed(low, high);
10201020
}
10211021

1022-
fn multiplyVec<T: Copy>(arr: &[const T], num: uint) -> ~[mut T] {
1022+
fn multiplyVec<T: Copy>(arr: &[const T], num: uint) -> ~[T] {
10231023
let size = arr.len();
10241024
let res = do vec::from_fn(num) |i| {
10251025
arr[i % size]

branches/try/src/libstd/sync.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ fn new_sem<Q: Owned>(count: int, q: Q) -> Sem<Q> {
9292
}
9393
#[doc(hidden)]
9494
fn new_sem_and_signal(count: int, num_condvars: uint)
95-
-> Sem<~[mut Waitqueue]> {
95+
-> Sem<~[Waitqueue]> {
9696
let mut queues = ~[];
9797
for num_condvars.times {
9898
queues.push(new_waitqueue());
@@ -150,7 +150,7 @@ impl &Sem<()> {
150150
}
151151
}
152152
#[doc(hidden)]
153-
impl &Sem<~[mut Waitqueue]> {
153+
impl &Sem<~[Waitqueue]> {
154154
fn access<U>(blk: fn() -> U) -> U {
155155
let mut release = None;
156156
unsafe {
@@ -166,7 +166,7 @@ impl &Sem<~[mut Waitqueue]> {
166166
// FIXME(#3588) should go inside of access()
167167
#[doc(hidden)]
168168
type SemRelease = SemReleaseGeneric<()>;
169-
type SemAndSignalRelease = SemReleaseGeneric<~[mut Waitqueue]>;
169+
type SemAndSignalRelease = SemReleaseGeneric<~[Waitqueue]>;
170170
struct SemReleaseGeneric<Q> { sem: &Sem<Q> }
171171

172172
impl<Q: Owned> SemReleaseGeneric<Q> : Drop {
@@ -181,15 +181,15 @@ fn SemRelease(sem: &r/Sem<()>) -> SemRelease/&r {
181181
}
182182
}
183183

184-
fn SemAndSignalRelease(sem: &r/Sem<~[mut Waitqueue]>)
184+
fn SemAndSignalRelease(sem: &r/Sem<~[Waitqueue]>)
185185
-> SemAndSignalRelease/&r {
186186
SemReleaseGeneric {
187187
sem: sem
188188
}
189189
}
190190

191191
/// A mechanism for atomic-unlock-and-deschedule blocking and signalling.
192-
pub struct Condvar { priv sem: &Sem<~[mut Waitqueue]> }
192+
pub struct Condvar { priv sem: &Sem<~[Waitqueue]> }
193193

194194
impl Condvar : Drop { fn finalize(&self) {} }
195195

@@ -259,7 +259,7 @@ impl &Condvar {
259259
// mutex during unwinding. As long as the wrapper (mutex, etc) is
260260
// bounded in when it gets released, this shouldn't hang forever.
261261
struct SemAndSignalReacquire {
262-
sem: &Sem<~[mut Waitqueue]>,
262+
sem: &Sem<~[Waitqueue]>,
263263
}
264264

265265
impl SemAndSignalReacquire : Drop {
@@ -273,7 +273,7 @@ impl &Condvar {
273273
}
274274
}
275275

276-
fn SemAndSignalReacquire(sem: &r/Sem<~[mut Waitqueue]>)
276+
fn SemAndSignalReacquire(sem: &r/Sem<~[Waitqueue]>)
277277
-> SemAndSignalReacquire/&r {
278278
SemAndSignalReacquire {
279279
sem: sem
@@ -345,7 +345,7 @@ fn check_cvar_bounds<U>(out_of_bounds: Option<uint>, id: uint, act: &str,
345345
}
346346

347347
#[doc(hidden)]
348-
impl &Sem<~[mut Waitqueue]> {
348+
impl &Sem<~[Waitqueue]> {
349349
// The only other place that condvars get built is rwlock_write_mode.
350350
fn access_cond<U>(blk: fn(c: &Condvar) -> U) -> U {
351351
do self.access { blk(&Condvar { sem: self }) }
@@ -400,7 +400,7 @@ impl &Semaphore {
400400
* A task which fails while holding a mutex will unlock the mutex as it
401401
* unwinds.
402402
*/
403-
struct Mutex { priv sem: Sem<~[mut Waitqueue]> }
403+
struct Mutex { priv sem: Sem<~[Waitqueue]> }
404404

405405
/// Create a new mutex, with one associated condvar.
406406
pub fn Mutex() -> Mutex { mutex_with_condvars(1) }
@@ -450,7 +450,7 @@ struct RWlockInner {
450450
*/
451451
struct RWlock {
452452
priv order_lock: Semaphore,
453-
priv access_lock: Sem<~[mut Waitqueue]>,
453+
priv access_lock: Sem<~[Waitqueue]>,
454454
priv state: Exclusive<RWlockInner>
455455
}
456456

branches/try/src/libsyntax/print/pp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ pub fn tok_str(++t: token) -> ~str {
119119
}
120120
}
121121

122-
pub fn buf_str(toks: ~[mut token], szs: ~[mut int], left: uint, right: uint,
122+
pub fn buf_str(toks: ~[token], szs: ~[int], left: uint, right: uint,
123123
lim: uint) -> ~str {
124124
let n = vec::len(toks);
125125
assert (n == vec::len(szs));

branches/try/src/test/bench/sudoku.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ use io::{ReaderUtil, WriterUtil};
3232
export grid_t, read_grid, solve_grid, write_grid;
3333

3434
// internal type of sudoku grids
35-
type grid = ~[~[mut u8]];
35+
type grid = ~[~[u8]];
3636

3737
// exported type of sudoku grids
3838
enum grid_t { grid_ctor(grid), }

branches/try/src/test/compile-fail/borrowck-mut-vec-as-imm-slice-bad.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ fn want_slice(v: &[int]) -> int {
1414
return sum;
1515
}
1616

17-
fn has_mut_vec(+v: @~[mut int]) -> int {
17+
fn has_mut_vec(+v: @~[int]) -> int {
1818
want_slice(*v) //~ ERROR illegal borrow unless pure
1919
//~^ NOTE impure due to access to impure function
2020
}
2121

2222
fn main() {
23-
assert has_mut_vec(@~[mut 1, 2, 3]) == 6;
23+
assert has_mut_vec(@~[1, 2, 3]) == 6;
2424
}

branches/try/src/test/compile-fail/issue-2548.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ fn main() {
3434
let mut res = foo(x);
3535

3636
let mut v = ~[];
37-
v = move ~[mut (move res)] + v; //~ ERROR instantiating a type parameter with an incompatible type (needs `copy`, got `&static`, missing `copy`)
37+
v = move ~[(move res)] + v; //~ ERROR instantiating a type parameter with an incompatible type (needs `copy`, got `&static`, missing `copy`)
3838
assert (v.len() == 2);
3939
}
4040

branches/try/src/test/compile-fail/mutable-huh-variance-box.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ fn main() {
1414
let v = @mut ~[0];
1515

1616
fn f(&&v: @mut ~[const int]) {
17-
*v = ~[mut 3]
17+
*v = ~[3]
1818
}
1919

2020
f(v);

branches/try/src/test/compile-fail/mutable-huh-variance-deep.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
fn main() {
1414
let mut v = ~[@mut ~mut ~[0]];
1515

16-
fn f(&&v: ~[mut @mut ~mut ~[const int]]) {
16+
fn f(&&v: ~[@mut ~mut ~[const int]]) {
1717
}
1818

1919
f(v);

branches/try/src/test/compile-fail/mutable-huh-variance-ptr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ fn main() {
1818

1919
fn f(&&v: *mut ~[const int]) {
2020
unsafe {
21-
*v = ~[mut 3]
21+
*v = ~[3]
2222
}
2323
}
2424

branches/try/src/test/compile-fail/mutable-huh-variance-rec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ fn main() {
1414
let v = {mut g: ~[0]};
1515

1616
fn f(&&v: {mut g: ~[const int]}) {
17-
v.g = ~[mut 3]
17+
v.g = ~[3]
1818
}
1919

2020
f(v);

branches/try/src/test/compile-fail/mutable-huh-variance-unique.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ fn main() {
1414
let v = ~mut ~[0];
1515

1616
fn f(&&v: ~mut ~[const int]) {
17-
*v = ~[mut 3]
17+
*v = ~[3]
1818
}
1919

2020
f(v);

branches/try/src/test/compile-fail/mutable-huh-variance-vec1.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
fn main() {
1212
// Note: explicit type annot is required here
1313
// because otherwise the inference gets smart
14-
// and assigns a type of ~[mut ~[const int]].
14+
// and assigns a type of ~[~[const int]].
1515
let mut v: ~[~[int]] = ~[~[0]];
1616

17-
fn f(&&v: ~[mut ~[const int]]) {
18-
v[0] = ~[mut 3]
17+
fn f(&&v: ~[~[const int]]) {
18+
v[0] = ~[3]
1919
}
2020

2121
f(v); //~ ERROR (values differ in mutability)

branches/try/src/test/compile-fail/mutable-huh-variance-vec2.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
fn main() {
1212
// Note: explicit type annot is required here
1313
// because otherwise the inference gets smart
14-
// and assigns a type of ~[mut ~[const int]].
15-
let mut v: ~[~[mut int]] = ~[~[0]];
14+
// and assigns a type of ~[~[const int]].
15+
let mut v: ~[~[int]] = ~[~[0]];
1616

17-
fn f(&&v: ~[mut ~[const int]]) {
17+
fn f(&&v: ~[~[const int]]) {
1818
v[0] = ~[3]
1919
}
2020

branches/try/src/test/compile-fail/mutable-huh-variance-vec3.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
fn main() {
1212
// Note: explicit type annot is required here
1313
// because otherwise the inference gets smart
14-
// and assigns a type of ~[mut ~[const int]].
15-
let mut v: ~[~[mut ~[int]]] = ~[~[~[0]]];
14+
// and assigns a type of ~[~[const int]].
15+
let mut v: ~[~[~[int]]] = ~[~[~[0]]];
1616

17-
fn f(&&v: ~[mut ~[mut ~[const int]]]) {
18-
v[0][1] = ~[mut 3]
17+
fn f(&&v: ~[~[~[const int]]]) {
18+
v[0][1] = ~[3]
1919
}
2020

2121
f(v); //~ ERROR (values differ in mutability)

branches/try/src/test/compile-fail/mutable-huh-variance-vec4.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ fn main() {
1717
let mut w = ~[~[0]];
1818
let mut x = ~[~[0]];
1919

20-
fn f(&&v: ~[mut ~[int]]) {
20+
fn f(&&v: ~[~[int]]) {
2121
v[0] = ~[3]
2222
}
2323

2424
fn g(&&v: ~[const ~[const int]]) {
2525
}
2626

27-
fn h(&&v: ~[mut ~[mut int]]) {
28-
v[0] = ~[mut 3]
27+
fn h(&&v: ~[~[int]]) {
28+
v[0] = ~[3]
2929
}
3030

31-
fn i(&&v: ~[mut ~[const int]]) {
32-
v[0] = ~[mut 3]
31+
fn i(&&v: ~[~[const int]]) {
32+
v[0] = ~[3]
3333
}
3434

3535
fn j(&&v: ~[~[const int]]) {
@@ -48,7 +48,7 @@ fn main() {
4848
j(w); //~ ERROR (values differ in mutability)
4949

5050
// Note that without adding f() or h() to the mix, it is valid for
51-
// x to have the type ~[mut ~[const int]], and thus we can safely
51+
// x to have the type ~[~[const int]], and thus we can safely
5252
// call g() and i() but not j():
5353
g(x);
5454
i(x);

branches/try/src/test/compile-fail/non-const.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ fn main() {
4444
foo({f: 3});
4545
foo({mut f: 3}); //~ ERROR missing `const`
4646
foo(~[1]);
47-
foo(~[mut 1]); //~ ERROR missing `const`
47+
foo(~[1]); //~ ERROR missing `const`
4848
foo(~1);
4949
foo(~mut 1); //~ ERROR missing `const`
5050
foo(@1);

0 commit comments

Comments
 (0)