From 4f2f87b2dff5b586d3130737716fcbb3d3086d57 Mon Sep 17 00:00:00 2001 From: LeSeulArtichaut Date: Fri, 4 Sep 2020 22:03:45 +0200 Subject: [PATCH] Change `ty.kind` -> `ty.kind()` --- rust-version | 2 +- src/helpers.rs | 2 +- src/shims/intrinsics.rs | 8 ++++---- src/stacked_borrows.rs | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/rust-version b/rust-version index 6e9f26cbe4..797f6e825a 100644 --- a/rust-version +++ b/rust-version @@ -1 +1 @@ -d9cd4a33f53689bc0847775669a14f666a138fd7 +d2454643e137bde519786ee9e650c455d7ad6f34 diff --git a/src/helpers.rs b/src/helpers.rs index 39af9d3143..d3fcb1c53d 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -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, diff --git a/src/shims/intrinsics.rs b/src/shims/intrinsics.rs index 53d4d08eba..4d8801f178 100644 --- a/src/shims/intrinsics.rs +++ b/src/shims/intrinsics.rs @@ -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. diff --git a/src/stacked_borrows.rs b/src/stacked_borrows.rs index cefe334574..817ed99d2b 100644 --- a/src/stacked_borrows.rs +++ b/src/stacked_borrows.rs @@ -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 },