Skip to content

Commit dafd759

Browse files
committed
Repair RIMOV damage to libstd
1 parent 5e55fe8 commit dafd759

File tree

5 files changed

+9
-10
lines changed

5 files changed

+9
-10
lines changed

src/libstd/bitv.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ pub fn Bitv (nbits: uint, init: bool) -> Bitv {
233233
let nelems = nbits/uint_bits +
234234
if nbits % uint_bits == 0 {0} else {1};
235235
let elem = if init {!0} else {0};
236-
let s = cast_to_mut(from_elem(nelems, elem));
236+
let s = from_elem(nelems, elem);
237237
Big(~BigBitv(move s))
238238
};
239239
Bitv {rep: move rep, nbits: nbits}
@@ -518,7 +518,7 @@ impl Bitv: Clone {
518518
Bitv{nbits: self.nbits, rep: Small(~SmallBitv{bits: b.bits})}
519519
}
520520
Big(ref b) => {
521-
let st = cast_to_mut(from_elem(self.nbits / uint_bits + 1, 0));
521+
let mut st = from_elem(self.nbits / uint_bits + 1, 0);
522522
let len = st.len();
523523
for uint::range(0, len) |i| { st[i] = b.storage[i]; };
524524
Bitv{nbits: self.nbits, rep: Big(~BigBitv{storage: move st})}

src/libstd/map.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ pub mod chained {
209209
fn rehash() {
210210
let n_old_chains = self.chains.len();
211211
let n_new_chains: uint = uint::next_power_of_two(n_old_chains+1u);
212-
let new_chains = chains(n_new_chains);
212+
let mut new_chains = chains(n_new_chains);
213213
for self.each_entry |entry| {
214214
let idx = entry.hash % n_new_chains;
215215
entry.next = new_chains[idx];
@@ -459,7 +459,7 @@ pub mod chained {
459459
}
460460

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

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

src/libstd/rope.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,8 +1168,7 @@ pub mod node {
11681168
}
11691169

11701170
pub fn start(node: @Node) -> T {
1171-
let stack = vec::cast_to_mut(
1172-
vec::from_elem(height(node)+1u, node));
1171+
let stack = vec::from_elem(height(node)+1u, node);
11731172
T {
11741173
stack: stack,
11751174
stackpos: 0,

src/libstd/sha1.rs

Lines changed: 3 additions & 3 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: ~[u32],
70+
{h: ~[mut u32],
7171
mut len_low: u32,
7272
mut len_high: u32,
73-
mut msg_block: ~[u8],
73+
msg_block: ~[mut u8],
7474
mut msg_block_idx: uint,
7575
mut computed: bool,
76-
work_buf: @~[u32]};
76+
work_buf: @~[mut u32]};
7777

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

src/libstd/sync.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ fn new_sem_and_signal(count: int, num_condvars: uint)
9797
for num_condvars.times {
9898
queues.push(new_waitqueue());
9999
}
100-
new_sem(count, vec::cast_to_mut(move queues))
100+
new_sem(count, queues)
101101
}
102102

103103
#[doc(hidden)]

0 commit comments

Comments
 (0)