summaryrefslogtreecommitdiff
path: root/src/hir/item_path.hpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2017-01-11 21:37:00 +0800
committerJohn Hodge <tpg@mutabah.net>2017-01-11 21:37:00 +0800
commitd8e1c31c2158f60ce19a09723904ab0b71f7c27a (patch)
treed17b4fc061bbb0fd7ec8b8f3efca10139c6f51c6 /src/hir/item_path.hpp
parent04b6360ff879a70a42fcd5f09cccc23cc2dd2d9f (diff)
downloadmrust-d8e1c31c2158f60ce19a09723904ab0b71f7c27a.tar.gz
All - Enable library codegen (and use crate name everywhere)
Diffstat (limited to 'src/hir/item_path.hpp')
-rw-r--r--src/hir/item_path.hpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/hir/item_path.hpp b/src/hir/item_path.hpp
index 606c6817..f0c591af 100644
--- a/src/hir/item_path.hpp
+++ b/src/hir/item_path.hpp
@@ -17,8 +17,9 @@ public:
const ::HIR::SimplePath* trait = nullptr;
const ::HIR::PathParams* trait_params = nullptr;
const char* name = nullptr;
+ const char* crate_name = nullptr;
- ItemPath() {}
+ ItemPath(const ::std::string& crate): crate_name(crate.c_str()) {}
ItemPath(const ItemPath& p, const char* n):
parent(&p),
name(n)
@@ -45,7 +46,8 @@ public:
}
else {
assert(!name);
- return ::HIR::SimplePath();
+ assert(crate_name);
+ return ::HIR::SimplePath(crate_name);
}
}
::HIR::Path get_full_path() const {