diff options
author | John Hodge <tpg@mutabah.net> | 2019-10-26 12:00:33 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2019-10-26 12:00:33 +0800 |
commit | 6a2e3b6a095a9a1acdccf4edee4ba3900ce6489a (patch) | |
tree | e2ae293dea1029479761cc824a8f97078c8f163b /src/mir/from_hir.cpp | |
parent | 14c531b0b6c2ac97334ad27483d8266065bda580 (diff) | |
download | mrust-6a2e3b6a095a9a1acdccf4edee4ba3900ce6489a.tar.gz |
HIR Typecheck - Allow coercion to add `unsafe` to function pointers
Diffstat (limited to 'src/mir/from_hir.cpp')
-rw-r--r-- | src/mir/from_hir.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mir/from_hir.cpp b/src/mir/from_hir.cpp index b8033a00..4ab1bf00 100644 --- a/src/mir/from_hir.cpp +++ b/src/mir/from_hir.cpp @@ -1279,6 +1279,11 @@ namespace { TU_MATCH_HDRA( (ty_out.m_data), {) default: BUG(node.span(), "Invalid cast to " << ty_out << " from " << ty_in); + TU_ARMA(Function, de) { + // Just trust the previous stages. + ASSERT_BUG(node.span(), ty_in.m_data.is_Function(), ty_in); + ASSERT_BUG(node.span(), de.m_arg_types == ty_in.m_data.as_Function().m_arg_types, ty_in); + } TU_ARMA(Pointer, de) { if( ty_in.m_data.is_Primitive() ) { const auto& ie = ty_in.m_data.as_Primitive(); |