]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_builtin_macros/src/test.rs
Rollup merge of #101769 - notriddle:notriddle/out-of-band-span-since, r=GuillaumeGomez
[rust.git] / compiler / rustc_builtin_macros / src / test.rs
index 03c84f5ec2a740fe1f158099885719b5369477c6..7efb6cc61eecbb2325525c4696b5b5b7c9040c8a 100644 (file)
@@ -1,7 +1,6 @@
 /// The expansion from a test function to the appropriate test struct for libtest
 /// Ideally, this code would be in libtest but for efficiency and error messages it lives here.
 use crate::util::{check_builtin_macro_attribute, warn_on_duplicate_attribute};
-
 use rustc_ast as ast;
 use rustc_ast::attr;
 use rustc_ast::ptr::P;
@@ -11,8 +10,8 @@
 use rustc_session::Session;
 use rustc_span::symbol::{sym, Ident, Symbol};
 use rustc_span::Span;
-
 use std::iter;
+use thin_vec::thin_vec;
 
 // #[test_case] is used by custom test authors to mark tests
 // When building for test, it needs to make the item public and gensym the name
@@ -219,7 +218,7 @@ pub fn expand_test_or_bench(
     let mut test_const = cx.item(
         sp,
         Ident::new(item.ident.name, sp),
-        vec![
+        thin_vec![
             // #[cfg(test)]
             cx.attribute(attr::mk_list_item(
                 Ident::new(sym::cfg, attr_sp),
@@ -227,8 +226,7 @@ pub fn expand_test_or_bench(
             )),
             // #[rustc_test_marker]
             cx.attribute(cx.meta_word(attr_sp, sym::rustc_test_marker)),
-        ]
-        .into(),
+        ],
         // const $ident: test::TestDescAndFn =
         ast::ItemKind::Const(
             ast::Defaultness::Final,
@@ -337,7 +335,7 @@ pub fn expand_test_or_bench(
     // extern crate test
     let test_extern = cx.item(sp, test_id, ast::AttrVec::new(), ast::ItemKind::ExternCrate(None));
 
-    tracing::debug!("synthetic test item:\n{}\n", pprust::item_to_string(&test_const));
+    debug!("synthetic test item:\n{}\n", pprust::item_to_string(&test_const));
 
     if is_stmt {
         vec![