Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTitor committed Jan 28, 2021
1 parent a0485c5 commit 53612ec
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
78e22069d018e83915201c8a218a0a94227f6420
0e190206e2ff0c13d64701d9b4145bf89a2d0cab
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#![warn(rust_2018_idioms)]
#![allow(clippy::cast_lossless)]

extern crate rustc_attr;
extern crate rustc_apfloat;
extern crate rustc_ast;
#[macro_use] extern crate rustc_middle;
Expand Down
8 changes: 3 additions & 5 deletions src/shims/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ use std::iter;

use log::trace;

use rustc_attr as attr;
use rustc_ast::ast::FloatTy;
use rustc_middle::{mir, mir::BinOp, ty};
use rustc_middle::{mir, mir::BinOp, ty, ty::FloatTy};
use rustc_middle::ty::layout::IntegerExt;
use rustc_apfloat::{Float, Round};
use rustc_target::abi::{Align, Integer, LayoutOf};
Expand Down Expand Up @@ -578,7 +576,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
Ok(match dest_ty.kind() {
// Unsigned
ty::Uint(t) => {
let size = Integer::from_attr(this, attr::IntType::UnsignedInt(*t)).size();
let size = Integer::from_uint_ty(this, *t).size();
let res = f.to_u128(size.bits_usize());
if res.status.is_empty() {
// No status flags means there was no further rounding or other loss of precision.
Expand All @@ -593,7 +591,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
}
// Signed
ty::Int(t) => {
let size = Integer::from_attr(this, attr::IntType::SignedInt(*t)).size();
let size = Integer::from_int_ty(this, *t).size();
let res = f.to_i128(size.bits_usize());
if res.status.is_empty() {
// No status flags means there was no further rounding or other loss of precision.
Expand Down

0 comments on commit 53612ec

Please sign in to comment.