From 2972b0f902bbdb2aab300e371c0fb618aaa928b3 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sat, 8 Oct 2016 09:30:32 +0800 Subject: MIR Gen - Allow casts to all integer types from pointers --- src/mir/from_hir.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mir/from_hir.cpp b/src/mir/from_hir.cpp index 500db069..10f9768d 100644 --- a/src/mir/from_hir.cpp +++ b/src/mir/from_hir.cpp @@ -930,7 +930,8 @@ namespace { BUG(node.span(), "Cannot cast to " << ty_out << " from " << ty_in); } ) - else if( de == ::HIR::CoreType::Usize && ty_in.m_data.is_Pointer() ) { + // NOTE: Valid for all integer types + else if( ty_in.m_data.is_Pointer() ) { // TODO: Only valid for T: Sized? } else if( de == ::HIR::CoreType::Usize && ty_in.m_data.is_Function() ) { -- cgit v1.2.3