summaryrefslogtreecommitdiff
path: root/src/hir/hir.hpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-06-12 23:41:04 +0800
committerJohn Hodge <tpg@mutabah.net>2016-06-12 23:41:04 +0800
commit9f9aca6f08c863d693ee6b63327618fd812f49ed (patch)
tree214b3b933fbc762eb42027f799394ffd168fca8d /src/hir/hir.hpp
parent7478d2e92eb3fb13cf36033a2a84a9bec6f20de4 (diff)
downloadmrust-9f9aca6f08c863d693ee6b63327618fd812f49ed.tar.gz
HIR - Trait scoping fixes
Diffstat (limited to 'src/hir/hir.hpp')
-rw-r--r--src/hir/hir.hpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/hir/hir.hpp b/src/hir/hir.hpp
index fb27c44d..e1163b49 100644
--- a/src/hir/hir.hpp
+++ b/src/hir/hir.hpp
@@ -211,6 +211,8 @@ public:
::HIR::TypeRef m_type;
::std::map< ::std::string, ::HIR::Function> m_methods;
+
+ ::HIR::SimplePath m_src_module;
bool matches_type(const ::HIR::TypeRef& tr, t_cb_resolve_type ty_res) const;
bool matches_type(const ::HIR::TypeRef& tr) const {
@@ -229,6 +231,8 @@ public:
::std::map< ::std::string, ::HIR::ExprPtr> m_constants;
::std::map< ::std::string, ::HIR::TypeRef> m_types;
+ ::HIR::SimplePath m_src_module;
+
bool matches_type(const ::HIR::TypeRef& tr, t_cb_resolve_type ty_res) const;
bool matches_type(const ::HIR::TypeRef& tr) const {
return matches_type(tr, [](const auto& x)->const auto&{ return x; });
@@ -243,6 +247,8 @@ public:
bool is_positive;
::HIR::TypeRef m_type;
+ ::HIR::SimplePath m_src_module;
+
bool matches_type(const ::HIR::TypeRef& tr, t_cb_resolve_type ty_res) const;
bool matches_type(const ::HIR::TypeRef& tr) const {
return matches_type(tr, [](const auto& x)->const auto&{ return x; });
@@ -272,6 +278,7 @@ public:
const ::HIR::Trait& get_trait_by_path(const Span& sp, const ::HIR::SimplePath& path) const;
const ::HIR::Struct& get_struct_by_path(const Span& sp, const ::HIR::SimplePath& path) const;
const ::HIR::Enum& get_enum_by_path(const Span& sp, const ::HIR::SimplePath& path) const;
+ const ::HIR::Module& get_mod_by_path(const Span& sp, const ::HIR::SimplePath& path) const;
const ::HIR::ValueItem& get_valitem_by_path(const Span& sp, const ::HIR::SimplePath& path) const;
const ::HIR::Function& get_function_by_path(const Span& sp, const ::HIR::SimplePath& path) const;