summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Hodge <tpg@ucc.asn.au>2019-07-07 13:31:30 +0800
committerJohn Hodge <tpg@ucc.asn.au>2019-07-07 13:31:30 +0800
commit153066708c20b2204b8823385c0b32860fb61619 (patch)
tree86b3c548698d5832b5a4336829832ecaf81e601e
parenta94abe48f395b161ade776c019da12ba99eb5e88 (diff)
downloadmrust-153066708c20b2204b8823385c0b32860fb61619.tar.gz
Expand module_path - Include crate name (for RUST_LOG)
-rw-r--r--src/expand/file_line.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/expand/file_line.cpp b/src/expand/file_line.cpp
index 09d3e6b2..9337bbf5 100644
--- a/src/expand/file_line.cpp
+++ b/src/expand/file_line.cpp
@@ -8,6 +8,7 @@
#include <synext.hpp>
#include "../parse/common.hpp"
#include "../parse/ttstream.hpp"
+#include <ast/crate.hpp>
namespace {
const Span& get_top_span(const Span& sp) {
@@ -61,8 +62,9 @@ class CExpanderModulePath:
::std::unique_ptr<TokenStream> expand(const Span& sp, const AST::Crate& crate, const TokenTree& tt, AST::Module& mod) override
{
::std::string path_str;
+ path_str += crate.m_crate_name;
for(const auto& comp : mod.path().nodes()) {
- if( &comp != &mod.path().nodes().front() )
+ if( !path_str.empty() )
path_str += "::";
path_str += comp.name().c_str();
}