Skip to content

Commit 2dff9be

Browse files
committed
---
yaml --- r: 44797 b: refs/heads/master c: 061a223 h: refs/heads/master i: 44795: 5ef44a1 v: v3
1 parent 8c1d07c commit 2dff9be

File tree

5 files changed

+114
-136
lines changed

5 files changed

+114
-136
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 5ae9b2949fd632f20ccc8afe30e273c0aa5b665b
2+
refs/heads/master: 061a2237230d3abcdb30ecb8987e5de17e67a58e
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d9689399d091c3265f00434a69c551a61c28dc
55
refs/heads/try: ef355f6332f83371e4acf04fc4eb940ab41d78d3

trunk/src/librustc/middle/check_match.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,11 @@ pub fn check_expr(cx: @MatchCheckCtxt, ex: @expr, &&s: (), v: visit::vt<()>) {
101101
_ => { /* We assume only enum types can be uninhabited */ }
102102
}
103103
let arms = vec::concat(arms.filter_mapped(unguarded_pat));
104-
check_exhaustive(cx, ex.span, arms);
104+
if arms.is_empty() {
105+
cx.tcx.sess.span_err(ex.span, ~"non-exhaustive patterns");
106+
} else {
107+
check_exhaustive(cx, ex.span, arms);
108+
}
105109
}
106110
_ => ()
107111
}

trunk/src/libstd/sha1.rs

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,7 @@ pub fn sha1() -> Sha1 {
251251
let rr = mk_result(self);
252252
let mut s = ~"";
253253
for vec::each(rr) |b| {
254-
let hex = uint::to_str_radix(*b as uint, 16u);
255-
if hex.len() == 1 {
256-
s += "0";
257-
}
258-
s += hex;
254+
s += uint::to_str_radix(*b as uint, 16u);
259255
}
260256
return s;
261257
}
@@ -287,7 +283,6 @@ mod tests {
287283
struct Test {
288284
input: ~str,
289285
output: ~[u8],
290-
output_str: ~str,
291286
}
292287

293288
fn a_million_letter_a() -> ~str {
@@ -311,7 +306,6 @@ mod tests {
311306
0x78u8, 0x50u8, 0xC2u8, 0x6Cu8,
312307
0x9Cu8, 0xD0u8, 0xD8u8, 0x9Du8,
313308
],
314-
output_str: ~"a9993e364706816aba3e25717850c26c9cd0d89d"
315309
},
316310
Test {
317311
input:
@@ -324,7 +318,6 @@ mod tests {
324318
0xF9u8, 0x51u8, 0x29u8, 0xE5u8,
325319
0xE5u8, 0x46u8, 0x70u8, 0xF1u8,
326320
],
327-
output_str: ~"84983e441c3bd26ebaae4aa1f95129e5e54670f1"
328321
},
329322
Test {
330323
input: a_million_letter_a(),
@@ -335,7 +328,6 @@ mod tests {
335328
0xDBu8, 0xADu8, 0x27u8, 0x31u8,
336329
0x65u8, 0x34u8, 0x01u8, 0x6Fu8,
337330
],
338-
output_str: ~"34aa973cd4c4daa4f61eeb2bdbad27316534016f"
339331
},
340332
];
341333
// Examples from wikipedia
@@ -350,7 +342,6 @@ mod tests {
350342
0xbbu8, 0x76u8, 0xe7u8, 0x39u8,
351343
0x1bu8, 0x93u8, 0xebu8, 0x12u8,
352344
],
353-
output_str: ~"2fd4e1c67a2d28fced849ee1bb76e7391b93eb12",
354345
},
355346
Test {
356347
input: ~"The quick brown fox jumps over the lazy cog",
@@ -361,7 +352,6 @@ mod tests {
361352
0x0bu8, 0xd1u8, 0x7du8, 0x9bu8,
362353
0x10u8, 0x0du8, 0xb4u8, 0xb3u8,
363354
],
364-
output_str: ~"de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3",
365355
},
366356
];
367357
let tests = fips_180_1_tests + wikipedia_tests;
@@ -383,11 +373,6 @@ mod tests {
383373
sh.input_str(t.input);
384374
let out = sh.result();
385375
check_vec_eq(t.output, out);
386-
387-
let out_str = sh.result_str();
388-
assert(out_str.len() == 40);
389-
assert(out_str == t.output_str);
390-
391376
sh.reset();
392377
}
393378

@@ -404,11 +389,6 @@ mod tests {
404389
}
405390
let out = sh.result();
406391
check_vec_eq(t.output, out);
407-
408-
let out_str = sh.result_str();
409-
assert(out_str.len() == 40);
410-
assert(out_str == t.output_str);
411-
412392
sh.reset();
413393
}
414394
}

0 commit comments

Comments
 (0)