Skip to content

Commit

Permalink
Fix new ? inference errors in librustc_mir
Browse files Browse the repository at this point in the history
  • Loading branch information
cuviper committed May 13, 2019
1 parent 002cfdb commit 6968e77
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/librustc_mir/hair/constant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ crate fn lit_to_const<'a, 'gcx, 'tcx>(
) -> Result<ty::Const<'tcx>, LitToConstError> {
use syntax::ast::*;

let trunc = |n| {
let trunc = |n| -> Result<_, LitToConstError> {
let param_ty = ParamEnv::reveal_all().and(tcx.lift_to_global(&ty).unwrap());
let width = tcx.layout_of(param_ty).map_err(|_| LitToConstError::Reported)?.size;
trace!("trunc {} with size {} and shift {}", n, width.bits(), 128 - width.bits());
Expand Down

0 comments on commit 6968e77

Please sign in to comment.