Address comments

This commit is contained in:
Vadim Petrochenkov
2018-06-30 01:53:17 +03:00
parent b69d51162b
commit 84f1bc8b66
4 changed files with 10 additions and 9 deletions

View File

@@ -1434,9 +1434,12 @@ pub mod __internal {
CURRENT_SESS.with(|p| {
let _reset = Reset { prev: p.get() };
// No way to determine def location for a proc macro rigth now, so use call location.
// No way to determine def location for a proc macro right now, so use call location.
let location = cx.current_expansion.mark.expn_info().unwrap().call_site;
// Opaque mark was already created by expansion, now create its transparent twin.
// We can't use the call-site span literally here, even if it appears to provide
// correct name resolution, because it has all the `ExpnInfo` wrong, so the edition
// checks, lint macro checks, macro backtraces will all break.
let opaque_mark = cx.current_expansion.mark;
let transparent_mark = Mark::fresh_cloned(opaque_mark);
transparent_mark.set_transparency(Transparency::Transparent);