]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_builtin_macros/env.rs
expand `env!` with def-site context
[rust.git] / src / librustc_builtin_macros / env.rs
index 21e1889513b01457049ba6287c2e25fa9c117a23..d769ebb1f5520d621ef27b299eccee1217607d49 100644 (file)
@@ -77,6 +77,7 @@ pub fn expand_env<'cx>(
         return DummyResult::any(sp);
     }
 
+    let sp = cx.with_def_site_ctxt(sp);
     let e = match env::var(&*var.as_str()) {
         Err(_) => {
             cx.span_err(sp, &msg.as_str());