From 153066708c20b2204b8823385c0b32860fb61619 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sun, 7 Jul 2019 13:31:30 +0800 Subject: Expand module_path - Include crate name (for RUST_LOG) --- src/expand/file_line.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') 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 #include "../parse/common.hpp" #include "../parse/ttstream.hpp" +#include namespace { const Span& get_top_span(const Span& sp) { @@ -61,8 +62,9 @@ class CExpanderModulePath: ::std::unique_ptr 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(); } -- cgit v1.2.3