summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-10-08 09:30:32 +0800
committerJohn Hodge <tpg@mutabah.net>2016-10-08 09:30:32 +0800
commit2972b0f902bbdb2aab300e371c0fb618aaa928b3 (patch)
treeefe2ac4015412b5d9f9756a7b5229804e0efe709 /src
parent0dd9c3321fbdd40fcc64aa8087e45e16788b0d37 (diff)
downloadmrust-2972b0f902bbdb2aab300e371c0fb618aaa928b3.tar.gz
MIR Gen - Allow casts to all integer types from pointers
Diffstat (limited to 'src')
-rw-r--r--src/mir/from_hir.cpp3
1 files changed, 2 insertions, 1 deletions
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() ) {