summaryrefslogtreecommitdiff
path: root/src/hir
diff options
context:
space:
mode:
Diffstat (limited to 'src/hir')
-rw-r--r--src/hir/expr_state.hpp4
-rw-r--r--src/hir/hir_ops.cpp3
2 files changed, 5 insertions, 2 deletions
diff --git a/src/hir/expr_state.hpp b/src/hir/expr_state.hpp
index 11fffe67..6151fb6b 100644
--- a/src/hir/expr_state.hpp
+++ b/src/hir/expr_state.hpp
@@ -16,8 +16,8 @@ public:
::HIR::SimplePath m_mod_path;
const ::HIR::Module& m_module;
- ::HIR::GenericParams* m_impl_generics;
- ::HIR::GenericParams* m_item_generics;
+ const ::HIR::GenericParams* m_impl_generics;
+ const ::HIR::GenericParams* m_item_generics;
::std::vector< ::std::pair< const ::HIR::SimplePath*, const ::HIR::Trait* > > m_traits;
diff --git a/src/hir/hir_ops.cpp b/src/hir/hir_ops.cpp
index 14533fb4..d9b1fb07 100644
--- a/src/hir/hir_ops.cpp
+++ b/src/hir/hir_ops.cpp
@@ -1074,6 +1074,8 @@ const ::MIR::Function* HIR::Crate::get_or_gen_mir(const ::HIR::ItemPath& ip, con
{
if( !ep )
{
+ // No HIR, so has to just have MIR - from a extern crate most likely
+ assert(ep.m_mir);
return &*ep.m_mir;
}
else
@@ -1096,6 +1098,7 @@ const ::MIR::Function* HIR::Crate::get_or_gen_mir(const ::HIR::ItemPath& ip, con
//Debug_SetStagePre("HIR Typecheck");
// - Can store that on the Expr, OR get it from the item path
typeck::ModuleState ms { const_cast<::HIR::Crate&>(*this) };
+ //ms.prepare_from_path( ip ); // <- Ideally would use this, but it's a lot of code for one usage
ms.m_impl_generics = ep.m_state->m_impl_generics;
ms.m_item_generics = ep.m_state->m_item_generics;
ms.m_traits = ep.m_state->m_traits;