Auto merge of #1534 - LeSeulArtichaut:tys-kind, r=RalfJung

Change `ty.kind` -> `ty.kind()`

This fixes build failure due to rust-lang/rust#75077, cc rust-lang/rust#76337.
(This is my first PR here, please tell me if anything's wrong)
This commit is contained in:
bors 2020-09-04 22:58:34 +00:00
commit 5f1182d04a
4 changed files with 7 additions and 7 deletions

View File

@ -1 +1 @@
d9cd4a33f53689bc0847775669a14f666a138fd7
d2454643e137bde519786ee9e650c455d7ad6f34

View File

@ -280,7 +280,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
// Hook to detect `UnsafeCell`.
fn visit_value(&mut self, v: MPlaceTy<'tcx, Tag>) -> InterpResult<'tcx> {
trace!("UnsafeCellVisitor: {:?} {:?}", *v, v.layout.ty);
let is_unsafe_cell = match v.layout.ty.kind {
let is_unsafe_cell = match v.layout.ty.kind() {
ty::Adt(adt, _) =>
Some(adt.did) == self.ecx.tcx.lang_items().unsafe_cell_type(),
_ => false,

View File

@ -299,7 +299,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
let &[val] = check_arg_count(args)?;
let val = this.read_immediate(val)?;
let res = match val.layout.ty.kind {
let res = match val.layout.ty.kind() {
ty::Float(FloatTy::F32) => {
this.float_to_int_unchecked(val.to_scalar()?.to_f32()?, dest.layout.ty)?
}
@ -528,10 +528,10 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
let f = f.round_to_integral(Round::TowardZero).value;
// Step 2: Cast the truncated float to the target integer type and see if we lose any information in this step.
Ok(match dest_ty.kind {
Ok(match dest_ty.kind() {
// Unsigned
ty::Uint(t) => {
let size = Integer::from_attr(this, attr::IntType::UnsignedInt(t)).size();
let size = Integer::from_attr(this, attr::IntType::UnsignedInt(*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.
@ -546,7 +546,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_attr(this, attr::IntType::SignedInt(*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.

View File

@ -623,7 +623,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
// Cannot use `builtin_deref` because that reports *immutable* for `Box`,
// making it useless.
fn qualify(ty: ty::Ty<'_>, kind: RetagKind) -> Option<(RefKind, bool)> {
match ty.kind {
match ty.kind() {
// References are simple.
ty::Ref(_, _, Mutability::Mut) => Some((
RefKind::Unique { two_phase: kind == RetagKind::TwoPhase },