diff options
author | John Hodge <tpg@mutabah.net> | 2016-06-11 12:05:30 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-06-11 12:05:30 +0800 |
commit | 5585040f36b6f8ffd6c0c44689525ce29ccb74d9 (patch) | |
tree | 9c5566dcb60260643293965cd216c505b4423ead /src/hir/hir.cpp | |
parent | 556cf732e28ae68185f778a4c5c63d0d2bec032a (diff) | |
download | mrust-5585040f36b6f8ffd6c0c44689525ce29ccb74d9.tar.gz |
HIR Typecheck - autoderef arrays to slices, don't check method if unknown
Diffstat (limited to 'src/hir/hir.cpp')
-rw-r--r-- | src/hir/hir.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/hir/hir.cpp b/src/hir/hir.cpp index 818b7b28..1eb4609a 100644 --- a/src/hir/hir.cpp +++ b/src/hir/hir.cpp @@ -170,6 +170,9 @@ const ::HIR::SimplePath& ::HIR::Crate::get_lang_item_path(const Span& sp, const const ::HIR::TypeItem& ::HIR::Crate::get_typeitem_by_path(const Span& sp, const ::HIR::SimplePath& path) const { + if( path.m_components.size() == 0) { + BUG(sp, "get_typeitem_by_path received invalid path"); + } if( path.m_crate_name != "" ) TODO(sp, "::HIR::Crate::get_typeitem_by_path in extern crate"); @@ -229,6 +232,9 @@ const ::HIR::Enum& ::HIR::Crate::get_enum_by_path(const Span& sp, const ::HIR::S const ::HIR::ValueItem& ::HIR::Crate::get_valitem_by_path(const Span& sp, const ::HIR::SimplePath& path) const { + if( path.m_components.size() == 0) { + BUG(sp, "get_valitem_by_path received invalid path"); + } if( path.m_crate_name != "" ) TODO(sp, "::HIR::Crate::get_valitem_by_path in extern crate"); |