about summary refs log tree commit diff
path: root/src/libsyntax_ext/test.rs
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-06-19 01:52:10 +0200
committerGitHub <noreply@github.com>2019-06-19 01:52:10 +0200
commitd51002ce078c5de8d49e700b3c22c9c3cc84ff94 (patch)
treea1ad2f138f5c3bf5f37c396b4d974e4ea3eca0dd /src/libsyntax_ext/test.rs
parentdcd5b20177f7b8408ccc42869e9151f7cfd45686 (diff)
parente152554e11ff44b1a08e21a8416e1fc18504764e (diff)
downloadrust-d51002ce078c5de8d49e700b3c22c9c3cc84ff94.tar.gz
rust-d51002ce078c5de8d49e700b3c22c9c3cc84ff94.zip
Rollup merge of #61898 - petrochenkov:sekind, r=eddyb
syntax: Factor out common fields from `SyntaxExtension` variants

And some other related cleanups.

Continuation of https://github.com/rust-lang/rust/pull/61606.
This will also help to unblock https://github.com/rust-lang/rust/pull/61877.
Diffstat (limited to 'src/libsyntax_ext/test.rs')
-rw-r--r--src/libsyntax_ext/test.rs15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/libsyntax_ext/test.rs b/src/libsyntax_ext/test.rs
index c20dc6cb2d7..24d3055e711 100644
--- a/src/libsyntax_ext/test.rs
+++ b/src/libsyntax_ext/test.rs
@@ -8,7 +8,7 @@ use syntax::attr;
 use syntax::ast;
 use syntax::print::pprust;
 use syntax::symbol::{Symbol, sym};
-use syntax_pos::{DUMMY_SP, Span};
+use syntax_pos::Span;
 use syntax::source_map::{ExpnInfo, MacroAttribute};
 use std::iter;
 
@@ -62,15 +62,10 @@ pub fn expand_test_or_bench(
 
     let (sp, attr_sp) = {
         let mark = Mark::fresh(Mark::root());
-        mark.set_expn_info(ExpnInfo {
-            call_site: DUMMY_SP,
-            def_site: None,
-            format: MacroAttribute(sym::test),
-            allow_internal_unstable: Some(vec![sym::rustc_attrs, sym::test].into()),
-            allow_internal_unsafe: false,
-            local_inner_macros: false,
-            edition: cx.parse_sess.edition,
-        });
+        mark.set_expn_info(ExpnInfo::with_unstable(
+            MacroAttribute(sym::test), attr_sp, cx.parse_sess.edition,
+            &[sym::rustc_attrs, sym::test],
+        ));
         (item.span.with_ctxt(SyntaxContext::empty().apply_mark(mark)),
          attr_sp.with_ctxt(SyntaxContext::empty().apply_mark(mark)))
     };