]> git.proxmox.com Git - rustc.git/blobdiff - compiler/rustc_builtin_macros/src/test_harness.rs
New upstream version 1.56.0~beta.4+dfsg1
[rustc.git] / compiler / rustc_builtin_macros / src / test_harness.rs
index 74a97a4058fac41dc3abef27402d7160c45f1786..d791677cb8ee1adbd64cd24f9df8aa3fe5aa1c2c 100644 (file)
@@ -188,8 +188,7 @@ impl<'a> MutVisitor for EntryPointCleaner<'a> {
                     let attrs = attrs
                         .into_iter()
                         .filter(|attr| {
-                            !self.sess.check_name(attr, sym::rustc_main)
-                                && !self.sess.check_name(attr, sym::start)
+                            !attr.has_name(sym::rustc_main) && !attr.has_name(sym::start)
                         })
                         .chain(iter::once(allow_dead_code))
                         .collect();
@@ -315,8 +314,12 @@ fn mk_main(cx: &mut TestCtxt<'_>) -> P<ast::Item> {
     let decl = ecx.fn_decl(vec![], ast::FnRetTy::Ty(main_ret_ty));
     let sig = ast::FnSig { decl, header: ast::FnHeader::default(), span: sp };
     let def = ast::Defaultness::Final;
-    let main =
-        ast::ItemKind::Fn(box ast::FnKind(def, sig, ast::Generics::default(), Some(main_body)));
+    let main = ast::ItemKind::Fn(Box::new(ast::FnKind(
+        def,
+        sig,
+        ast::Generics::default(),
+        Some(main_body),
+    )));
 
     // Honor the reexport_test_harness_main attribute
     let main_id = match cx.reexport_test_harness_main {