Skip to content

Commit

Permalink
Change the name of "inner" function generated by #[sqlx::test] (#3072)
Browse files Browse the repository at this point in the history
  • Loading branch information
ciffelia authored Feb 25, 2024
1 parent b615d2a commit 8c43b8c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sqlx-macros-core/src/test_attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ fn expand_advanced(args: syn::AttributeArgs, input: syn::ItemFn) -> crate::Resul
#[::core::prelude::v1::test]
#(#attrs)*
fn #name() #ret {
async fn inner(#inputs) #ret {
async fn #name(#inputs) #ret {
#body
}

Expand All @@ -172,7 +172,7 @@ fn expand_advanced(args: syn::AttributeArgs, input: syn::ItemFn) -> crate::Resul
args.fixtures(&[#(#fixtures),*]);

// We need to give a coercion site or else we get "unimplemented trait" errors.
let f: fn(#(#fn_arg_types),*) -> _ = inner;
let f: fn(#(#fn_arg_types),*) -> _ = #name;

::sqlx::testing::TestFn::run_test(f, args)
}
Expand Down

0 comments on commit 8c43b8c

Please sign in to comment.