Skip to content

Commit b8ea4e5

Browse files
committed
---
yaml --- r: 273123 b: refs/heads/beta c: a48bd17 h: refs/heads/master i: 273121: da4eb11 273119: 574c651
1 parent 93f5bc8 commit b8ea4e5

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: bba1596c71989bdbad19ec06b27fa0d81d5bc58f
26+
refs/heads/beta: a48bd1718356cdcc4204b57ed282ff8111df5427
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

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

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -854,16 +854,12 @@ pub fn eval_const_expr_partial<'tcx>(tcx: &TyCtxt<'tcx>,
854854
Some(actual_e) => actual_e,
855855
None => signal!(e, NonConstPath)
856856
};
857-
let item_hint = if let UncheckedExprNoHint = ty_hint {
858-
match const_ty {
859-
Some(ty) => match ast_ty_to_prim_ty(tcx, ty) {
860-
Some(ty) => UncheckedExprHint(ty),
861-
None => UncheckedExprNoHint
862-
},
863-
None => UncheckedExprNoHint
864-
}
865-
} else {
866-
ty_hint
857+
let item_hint = match const_ty {
858+
Some(ty) => match ast_ty_to_prim_ty(tcx, ty) {
859+
Some(ty) => ty_hint.checked_or(ty),
860+
None => ty_hint.erase_hint(),
861+
},
862+
None => ty_hint.erase_hint(),
867863
};
868864
try!(eval_const_expr_partial(tcx, const_expr, item_hint, fn_args))
869865
}

0 commit comments

Comments
 (0)