From 507381ed0367f27e8804a1da33f8565c96a260ce Mon Sep 17 00:00:00 2001 From: Oliver Scherer Date: Sat, 13 Oct 2018 23:38:31 +0200 Subject: Fix ICE and report a human readable error --- src/librustc/ty/cast.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/librustc') 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> { match t.sty { ty::Bool => Some(CastTy::Int(IntTy::Bool)), -- cgit 1.4.1-3-g733a5