|
1 | 1 | use mir; |
2 | | -use ty::{self, TypeVariants}; |
| 2 | +use ty::{self, Ty}; |
3 | 3 | use ty::layout::LayoutOf; |
4 | 4 | use syntax::codemap::Span; |
5 | 5 | use syntax::abi::Abi; |
@@ -177,16 +177,16 @@ impl<'a, 'tcx, M: Machine<'tcx>> EvalContext<'a, 'tcx, M> { |
177 | 177 | sig: ty::FnSig<'tcx>, |
178 | 178 | real_sig: ty::FnSig<'tcx>, |
179 | 179 | ) -> EvalResult<'tcx, bool> { |
180 | | - fn check_ty_compat<'tcx>(ty: ty::Ty<'tcx>, real_ty: ty::Ty<'tcx>) -> bool { |
| 180 | + fn check_ty_compat<'tcx>(ty: Ty<'tcx>, real_ty: Ty<'tcx>) -> bool { |
181 | 181 | if ty == real_ty { |
182 | 182 | return true; |
183 | 183 | } // This is actually a fast pointer comparison |
184 | 184 | return match (&ty.sty, &real_ty.sty) { |
185 | 185 | // Permit changing the pointer type of raw pointers and references as well as |
186 | 186 | // mutability of raw pointers. |
187 | 187 | // TODO: Should not be allowed when fat pointers are involved. |
188 | | - (&TypeVariants::TyRawPtr(_), &TypeVariants::TyRawPtr(_)) => true, |
189 | | - (&TypeVariants::TyRef(_, _), &TypeVariants::TyRef(_, _)) => { |
| 188 | + (&ty::TyRawPtr(_), &ty::TyRawPtr(_)) => true, |
| 189 | + (&ty::TyRef(_, _), &ty::TyRef(_, _)) => { |
190 | 190 | ty.is_mutable_pointer() == real_ty.is_mutable_pointer() |
191 | 191 | } |
192 | 192 | // rule out everything else |
@@ -220,7 +220,7 @@ impl<'a, 'tcx, M: Machine<'tcx>> EvalContext<'a, 'tcx, M> { |
220 | 220 | // Second argument must be a tuple matching the argument list of sig |
221 | 221 | let snd_ty = real_sig.inputs_and_output[1]; |
222 | 222 | match snd_ty.sty { |
223 | | - TypeVariants::TyTuple(tys, _) if sig.inputs().len() == tys.len() => |
| 223 | + ty::TyTuple(tys, _) if sig.inputs().len() == tys.len() => |
224 | 224 | if sig.inputs().iter().zip(tys).all(|(ty, real_ty)| check_ty_compat(ty, real_ty)) { |
225 | 225 | return Ok(true) |
226 | 226 | }, |
|
0 commit comments