about summary refs log tree commit diff
path: root/src/librustc/ty
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2018-10-19 11:03:30 +0800
committerkennytm <kennytm@gmail.com>2018-10-19 16:47:42 +0800
commit89ebc6ce4f7bcec8e0cdffe95bf8a92bbdfe04e5 (patch)
tree801b6b3e00d6634fdd25ed26d56dc09c5c230699 /src/librustc/ty
parent1419a697e3849cf929b70c4d2b61643190030981 (diff)
parent38f3ad41c0bbf6ed7c389a070afb60a465b3afe3 (diff)
downloadrust-89ebc6ce4f7bcec8e0cdffe95bf8a92bbdfe04e5.tar.gz
rust-89ebc6ce4f7bcec8e0cdffe95bf8a92bbdfe04e5.zip
Rollup merge of #55071 - oli-obk:const_cast_🍨, r=RalfJung
Fix ICE and report a human readable error

fixes #55063

r? @RalfJung
Diffstat (limited to 'src/librustc/ty')
-rw-r--r--src/librustc/ty/cast.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/librustc/ty/cast.rs b/src/librustc/ty/cast.rs
index c0861abb774..ab82f28c8bf 100644
--- a/src/librustc/ty/cast.rs
+++ b/src/librustc/ty/cast.rs
@@ -58,6 +58,8 @@ pub enum CastKind {
 }
 
 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 {
             ty::Bool => Some(CastTy::Int(IntTy::Bool)),