Skip to content

Commit d8e1792

Browse files
garethgareth
authored andcommitted
---
yaml --- r: 56179 b: refs/heads/auto c: caffe12 h: refs/heads/master i: 56177: 8bf560f 56175: 63f2df2 v: v3
1 parent 010b190 commit d8e1792

File tree

3 files changed

+27
-26
lines changed

3 files changed

+27
-26
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: 07e087bf310e7e7911bf05efa36a2cdb57855a4e
17+
refs/heads/auto: caffe127c78617b4c5eea8adaae17f20a816b651
1818
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1919
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c

branches/auto/src/libcore/run.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ mod tests {
520520
use run;
521521

522522
// Regression test for memory leaks
523-
#[ignore(cfg(windows))] // FIXME (#2626)
523+
#[test]
524524
fn test_leaks() {
525525
run::run_program("echo", []);
526526
run::start_program("echo", []);

branches/auto/src/librustc/middle/const_eval.rs

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -371,31 +371,32 @@ pub fn eval_const_expr_partial(tcx: middle::ty::ctxt, e: @expr)
371371
expr_cast(base, _) => {
372372
let ety = ty::expr_ty(tcx, e);
373373
let base = eval_const_expr_partial(tcx, base);
374-
match /*bad*/copy base {
375-
Err(_) => base,
376-
Ok(val) => {
377-
match ty::get(ety).sty {
378-
ty::ty_float(_) => match val {
379-
const_uint(u) => Ok(const_float(u as f64)),
380-
const_int(i) => Ok(const_float(i as f64)),
381-
const_float(_) => base,
382-
_ => Err(~"Can't cast float to str"),
383-
},
384-
ty::ty_uint(_) => match val {
385-
const_uint(_) => base,
386-
const_int(i) => Ok(const_uint(i as u64)),
387-
const_float(f) => Ok(const_uint(f as u64)),
388-
_ => Err(~"Can't cast str to uint"),
389-
},
390-
ty::ty_int(_) | ty::ty_bool => match val {
391-
const_uint(u) => Ok(const_int(u as i64)),
392-
const_int(_) => base,
393-
const_float(f) => Ok(const_int(f as i64)),
394-
_ => Err(~"Can't cast str to int"),
395-
},
396-
_ => Err(~"Can't cast this type")
397-
}
374+
match ty::get(ety).sty {
375+
ty::ty_float(_) => {
376+
match base {
377+
Ok(const_uint(u)) => Ok(const_float(u as f64)),
378+
Ok(const_int(i)) => Ok(const_float(i as f64)),
379+
Ok(const_float(_)) => base,
380+
_ => Err(~"Can't cast float to str")
381+
}
382+
}
383+
ty::ty_uint(_) => {
384+
match base {
385+
Ok(const_uint(_)) => base,
386+
Ok(const_int(i)) => Ok(const_uint(i as u64)),
387+
Ok(const_float(f)) => Ok(const_uint(f as u64)),
388+
_ => Err(~"Can't cast str to uint")
398389
}
390+
}
391+
ty::ty_int(_) | ty::ty_bool => {
392+
match base {
393+
Ok(const_uint(u)) => Ok(const_int(u as i64)),
394+
Ok(const_int(_)) => base,
395+
Ok(const_float(f)) => Ok(const_int(f as i64)),
396+
_ => Err(~"Can't cast str to int")
397+
}
398+
}
399+
_ => Err(~"Can't cast this type")
399400
}
400401
}
401402
expr_path(_) => {

0 commit comments

Comments
 (0)