]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/ty/cast.rs
Rollup merge of #64765 - alexcrichton:less-check-backtrace, r=sfackler
[rust.git] / src / librustc / ty / cast.rs
index 0b2112f42d5955af0d6667bddada424807d6fbac..bc12412312debcb100a70d0d5f0cbd9bcfb4bdf2 100644 (file)
@@ -4,6 +4,7 @@
 use crate::ty::{self, Ty};
 
 use syntax::ast;
+use rustc_macros::HashStable;
 
 /// Types that are represented as ints.
 #[derive(Copy, Clone, Debug, PartialEq, Eq)]
@@ -32,7 +33,7 @@ pub enum CastTy<'tcx> {
 }
 
 /// Cast Kind. See RFC 401 (or librustc_typeck/check/cast.rs)
-#[derive(Copy, Clone, Debug, RustcEncodable, RustcDecodable)]
+#[derive(Copy, Clone, Debug, RustcEncodable, RustcDecodable, HashStable)]
 pub enum CastKind {
     CoercionCast,
     PtrPtrCast,
@@ -51,7 +52,7 @@ impl<'tcx> CastTy<'tcx> {
     /// Returns `Some` for integral/pointer casts.
     /// casts like unsizing casts will return `None`
     pub fn from_ty(t: Ty<'tcx>) -> Option<CastTy<'tcx>> {
-        match t.sty {
+        match t.kind {
             ty::Bool => Some(CastTy::Int(IntTy::Bool)),
             ty::Char => Some(CastTy::Int(IntTy::Char)),
             ty::Int(_) => Some(CastTy::Int(IntTy::I)),