diff options
| author | Deadbeef <ent3rm4n@gmail.com> | 2025-08-09 13:24:06 +0800 |
|---|---|---|
| committer | Deadbeef <ent3rm4n@gmail.com> | 2025-08-09 15:47:01 +0800 |
| commit | ad1113f87ef828b300ebb8fca397efd358580da3 (patch) | |
| tree | 1698ee8e278895989d53e13aa569f1c9601b4d19 /compiler/rustc_builtin_macros/src/test.rs | |
| parent | 4c7749e8c8e50ad146da599eea3a250160c1bc2b (diff) | |
| download | rust-ad1113f87ef828b300ebb8fca397efd358580da3.tar.gz rust-ad1113f87ef828b300ebb8fca397efd358580da3.zip | |
remove `P`
Diffstat (limited to 'compiler/rustc_builtin_macros/src/test.rs')
| -rw-r--r-- | compiler/rustc_builtin_macros/src/test.rs | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/compiler/rustc_builtin_macros/src/test.rs b/compiler/rustc_builtin_macros/src/test.rs index 7b57c02b197..7a189ee1f4d 100644 --- a/compiler/rustc_builtin_macros/src/test.rs +++ b/compiler/rustc_builtin_macros/src/test.rs @@ -4,7 +4,6 @@ use std::assert_matches::assert_matches; use std::iter; -use rustc_ast::ptr::P; use rustc_ast::{self as ast, GenericParamKind, HasNodeId, attr, join_path_idents}; use rustc_ast_pretty::pprust; use rustc_attr_parsing::AttributeParser; @@ -78,7 +77,7 @@ pub(crate) fn expand_test_case( } let ret = if is_stmt { - Annotatable::Stmt(P(ecx.stmt_item(item.span, item))) + Annotatable::Stmt(Box::new(ecx.stmt_item(item.span, item))) } else { Annotatable::Item(item) }; @@ -131,7 +130,7 @@ pub(crate) fn expand_test_or_bench( let ast::ItemKind::Fn(fn_) = &item.kind else { not_testable_error(cx, attr_sp, Some(&item)); return if is_stmt { - vec![Annotatable::Stmt(P(cx.stmt_item(item.span, item)))] + vec![Annotatable::Stmt(Box::new(cx.stmt_item(item.span, item)))] } else { vec![Annotatable::Item(item)] }; @@ -155,7 +154,7 @@ pub(crate) fn expand_test_or_bench( }; if check_result.is_err() { return if is_stmt { - vec![Annotatable::Stmt(P(cx.stmt_item(item.span, item)))] + vec![Annotatable::Stmt(Box::new(cx.stmt_item(item.span, item)))] } else { vec![Annotatable::Item(item)] }; @@ -201,7 +200,7 @@ pub(crate) fn expand_test_or_bench( // `-Cinstrument-coverage` builds. // This requires `#[allow_internal_unstable(coverage_attribute)]` on the // corresponding macro declaration in `core::macros`. - let coverage_off = |mut expr: P<ast::Expr>| { + let coverage_off = |mut expr: Box<ast::Expr>| { assert_matches!(expr.kind, ast::ExprKind::Closure(_)); expr.attrs.push(cx.attr_nested_word(sym::coverage, sym::off, sp)); expr @@ -388,11 +387,11 @@ pub(crate) fn expand_test_or_bench( if is_stmt { vec![ // Access to libtest under a hygienic name - Annotatable::Stmt(P(cx.stmt_item(sp, test_extern))), + Annotatable::Stmt(Box::new(cx.stmt_item(sp, test_extern))), // The generated test case - Annotatable::Stmt(P(cx.stmt_item(sp, test_const))), + Annotatable::Stmt(Box::new(cx.stmt_item(sp, test_const))), // The original item - Annotatable::Stmt(P(cx.stmt_item(sp, item))), + Annotatable::Stmt(Box::new(cx.stmt_item(sp, item))), ] } else { vec