Skip to content

Commit cc636ce

Browse files
committed
---
yaml --- r: 32159 b: refs/heads/dist-snap c: d77acf7 h: refs/heads/master i: 32157: fd260c5 32155: 3654591 32151: ba61754 32143: f8c5b8e 32127: 9020d16 v: v3
1 parent 69b154a commit cc636ce

File tree

6 files changed

+53
-53
lines changed

6 files changed

+53
-53
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
10-
refs/heads/dist-snap: 4f326dd6504b6848e7b9cc831940d5452d873f56
10+
refs/heads/dist-snap: d77acf7d076fdd7c0b5cf7fae880728c0f6f80e1
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

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

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
#[forbid(deprecated_mode)];
2-
#[forbid(deprecated_pattern)];
3-
4-
fn md4(msg: &[u8]) -> {a: u32, b: u32, c: u32, d: u32} {
1+
fn md4(msg: ~[u8]) -> {a: u32, b: u32, c: u32, d: u32} {
52
// subtle: if orig_len is merely uint, then the code below
63
// which performs shifts by 32 bits or more has undefined
74
// results.
85
let orig_len: u64 = (vec::len(msg) * 8u) as u64;
96

107
// pad message
11-
let mut msg = vec::append(vec::from_slice(msg), ~[0x80u8]);
8+
let mut msg = vec::append(msg, ~[0x80u8]);
129
let mut bitlen = orig_len + 8u64;
1310
while (bitlen + 64u64) % 512u64 > 0u64 {
1411
vec::push(msg, 0u8);
@@ -85,7 +82,7 @@ fn md4(msg: &[u8]) -> {a: u32, b: u32, c: u32, d: u32} {
8582
return {a: a, b: b, c: c, d: d};
8683
}
8784

88-
fn md4_str(msg: &[u8]) -> ~str {
85+
fn md4_str(msg: ~[u8]) -> ~str {
8986
let {a, b, c, d} = md4(msg);
9087
fn app(a: u32, b: u32, c: u32, d: u32, f: fn(u32)) {
9188
f(a); f(b); f(c); f(d);
@@ -103,7 +100,7 @@ fn md4_str(msg: &[u8]) -> ~str {
103100
result
104101
}
105102

106-
fn md4_text(msg: &str) -> ~str { md4_str(str::to_bytes(msg)) }
103+
fn md4_text(msg: ~str) -> ~str { md4_str(str::to_bytes(msg)) }
107104

108105
#[test]
109106
fn test_md4() {

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

Lines changed: 33 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
* the `reset` method.
1313
*/
1414

15-
#[forbid(deprecated_mode)];
16-
#[forbid(deprecated_pattern)];
17-
1815
/*
1916
* A SHA-1 implementation derived from Paul E. Jones's reference
2017
* implementation, which is written for clarity, not speed. At some
@@ -25,9 +22,9 @@ export sha1;
2522
/// The SHA-1 interface
2623
trait sha1 {
2724
/// Provide message input as bytes
28-
fn input((&[u8]));
25+
fn input(~[u8]);
2926
/// Provide message input as string
30-
fn input_str((&str));
27+
fn input_str(~str);
3128
/**
3229
* Read the digest as a vector of 20 bytes. After calling this no further
3330
* input may be provided until reset is called.
@@ -63,7 +60,7 @@ fn sha1() -> sha1 {
6360
mut computed: bool,
6461
work_buf: @~[mut u32]};
6562

66-
fn add_input(st: &sha1state, msg: &[u8]) {
63+
fn add_input(st: sha1state, msg: ~[u8]) {
6764
assert (!st.computed);
6865
for vec::each(msg) |element| {
6966
st.msg_block[st.msg_block_idx] = element;
@@ -79,7 +76,7 @@ fn sha1() -> sha1 {
7976
if st.msg_block_idx == msg_block_len { process_msg_block(st); }
8077
}
8178
}
82-
fn process_msg_block(st: &sha1state) {
79+
fn process_msg_block(st: sha1state) {
8380
assert (vec::len(st.h) == digest_buf_len);
8481
assert (vec::len(*st.work_buf) == work_buf_len);
8582
let mut t: int; // Loop counter
@@ -158,10 +155,10 @@ fn sha1() -> sha1 {
158155
fn circular_shift(bits: u32, word: u32) -> u32 {
159156
return word << bits | word >> 32u32 - bits;
160157
}
161-
fn mk_result(st: &sha1state) -> ~[u8] {
162-
if !(*st).computed { pad_msg(st); (*st).computed = true; }
158+
fn mk_result(st: sha1state) -> ~[u8] {
159+
if !st.computed { pad_msg(st); st.computed = true; }
163160
let mut rs: ~[u8] = ~[];
164-
for vec::each_mut((*st).h) |ptr_hpart| {
161+
for vec::each_mut(st.h) |ptr_hpart| {
165162
let hpart = *ptr_hpart;
166163
let a = (hpart >> 24u32 & 0xFFu32) as u8;
167164
let b = (hpart >> 16u32 & 0xFFu32) as u8;
@@ -181,40 +178,40 @@ fn sha1() -> sha1 {
181178
* call process_msg_block() appropriately. When it returns, it
182179
* can be assumed that the message digest has been computed.
183180
*/
184-
fn pad_msg(st: &sha1state) {
185-
assert (vec::len((*st).msg_block) == msg_block_len);
181+
fn pad_msg(st: sha1state) {
182+
assert (vec::len(st.msg_block) == msg_block_len);
186183

187184
/*
188185
* Check to see if the current message block is too small to hold
189186
* the initial padding bits and length. If so, we will pad the
190187
* block, process it, and then continue padding into a second block.
191188
*/
192-
if (*st).msg_block_idx > 55u {
193-
(*st).msg_block[(*st).msg_block_idx] = 0x80u8;
194-
(*st).msg_block_idx += 1u;
195-
while (*st).msg_block_idx < msg_block_len {
196-
(*st).msg_block[(*st).msg_block_idx] = 0u8;
197-
(*st).msg_block_idx += 1u;
189+
if st.msg_block_idx > 55u {
190+
st.msg_block[st.msg_block_idx] = 0x80u8;
191+
st.msg_block_idx += 1u;
192+
while st.msg_block_idx < msg_block_len {
193+
st.msg_block[st.msg_block_idx] = 0u8;
194+
st.msg_block_idx += 1u;
198195
}
199196
process_msg_block(st);
200197
} else {
201-
(*st).msg_block[(*st).msg_block_idx] = 0x80u8;
202-
(*st).msg_block_idx += 1u;
198+
st.msg_block[st.msg_block_idx] = 0x80u8;
199+
st.msg_block_idx += 1u;
203200
}
204-
while (*st).msg_block_idx < 56u {
205-
(*st).msg_block[(*st).msg_block_idx] = 0u8;
206-
(*st).msg_block_idx += 1u;
201+
while st.msg_block_idx < 56u {
202+
st.msg_block[st.msg_block_idx] = 0u8;
203+
st.msg_block_idx += 1u;
207204
}
208205

209206
// Store the message length as the last 8 octets
210-
(*st).msg_block[56] = ((*st).len_high >> 24u32 & 0xFFu32) as u8;
211-
(*st).msg_block[57] = ((*st).len_high >> 16u32 & 0xFFu32) as u8;
212-
(*st).msg_block[58] = ((*st).len_high >> 8u32 & 0xFFu32) as u8;
213-
(*st).msg_block[59] = ((*st).len_high & 0xFFu32) as u8;
214-
(*st).msg_block[60] = ((*st).len_low >> 24u32 & 0xFFu32) as u8;
215-
(*st).msg_block[61] = ((*st).len_low >> 16u32 & 0xFFu32) as u8;
216-
(*st).msg_block[62] = ((*st).len_low >> 8u32 & 0xFFu32) as u8;
217-
(*st).msg_block[63] = ((*st).len_low & 0xFFu32) as u8;
207+
st.msg_block[56] = (st.len_high >> 24u32 & 0xFFu32) as u8;
208+
st.msg_block[57] = (st.len_high >> 16u32 & 0xFFu32) as u8;
209+
st.msg_block[58] = (st.len_high >> 8u32 & 0xFFu32) as u8;
210+
st.msg_block[59] = (st.len_high & 0xFFu32) as u8;
211+
st.msg_block[60] = (st.len_low >> 24u32 & 0xFFu32) as u8;
212+
st.msg_block[61] = (st.len_low >> 16u32 & 0xFFu32) as u8;
213+
st.msg_block[62] = (st.len_low >> 8u32 & 0xFFu32) as u8;
214+
st.msg_block[63] = (st.len_low & 0xFFu32) as u8;
218215
process_msg_block(st);
219216
}
220217

@@ -231,16 +228,13 @@ fn sha1() -> sha1 {
231228
self.h[4] = 0xC3D2E1F0u32;
232229
self.computed = false;
233230
}
234-
fn input(msg: &[u8]) { add_input(&self, msg); }
235-
fn input_str(msg: &str) {
236-
let bs = str::to_bytes(msg);
237-
add_input(&self, bs);
238-
}
239-
fn result() -> ~[u8] { return mk_result(&self); }
231+
fn input(msg: ~[u8]) { add_input(self, msg); }
232+
fn input_str(msg: ~str) { add_input(self, str::to_bytes(msg)); }
233+
fn result() -> ~[u8] { return mk_result(self); }
240234
fn result_str() -> ~str {
241-
let rr = mk_result(&self);
235+
let r = mk_result(self);
242236
let mut s = ~"";
243-
for vec::each(rr) |b| { s += uint::to_str(b as uint, 16u); }
237+
for vec::each(r) |b| { s += uint::to_str(b as uint, 16u); }
244238
return s;
245239
}
246240
}

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
//! Utilities that leverage libuv's `uv_timer_*` API
22
3-
#[forbid(deprecated_mode)];
4-
#[forbid(deprecated_pattern)];
5-
63
import uv = uv;
74
import uv::iotask;
85
import iotask::iotask;
@@ -27,7 +24,7 @@ export delayed_send, sleep, recv_timeout;
2724
* * val - a value of type T to send over the provided `ch`
2825
*/
2926
fn delayed_send<T: copy send>(iotask: iotask,
30-
msecs: uint, ch: comm::Chan<T>, +val: T) {
27+
msecs: uint, ch: comm::Chan<T>, val: T) {
3128
unsafe {
3229
let timer_done_po = core::comm::port::<()>();
3330
let timer_done_ch = core::comm::chan(timer_done_po);

branches/dist-snap/src/libsyntax/parse/parser.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2698,7 +2698,19 @@ struct parser {
26982698
!self.is_any_keyword(copy self.token)) &&
26992699
!self.token_is_pound_or_doc_comment(self.token) {
27002700
let a_var = self.parse_instance_var(vis);
2701-
self.expect(token::SEMI);
2701+
match self.token {
2702+
token::SEMI | token::COMMA => {
2703+
self.bump();
2704+
}
2705+
token::RBRACE => {}
2706+
_ => {
2707+
self.span_fatal(copy self.span,
2708+
fmt!("expected `;`, `,`, or '}' but \
2709+
found `%s`",
2710+
token_to_str(self.reader,
2711+
self.token)));
2712+
}
2713+
}
27022714
return a_var;
27032715
} else {
27042716
let m = self.parse_method(vis);

branches/dist-snap/src/libsyntax/print/pprust.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ fn print_struct(s: ps, struct_def: @ast::struct_def, tps: ~[ast::ty_param],
646646
print_ident(s, ident);
647647
word_nbsp(s, ~":");
648648
print_type(s, field.node.ty);
649-
word(s.s, ~";");
649+
word(s.s, ~",");
650650
}
651651
}
652652
}

0 commit comments

Comments
 (0)