ITADN

inner_attrs Ordering Expansion Problem

#155ClosedCarter12s 创建于 2026-02-23
C
Carter12scommented
Sorry to cause problems! With the release of v3.4 I actually attempted to use the inner_attrs feature to solve the issue I've been bumping up against. Fails to compile: ```rust #[serial(inner_attrs = [ntest::timeout(1_000)]] #[test_log::test(tokio::test(flavor = "multi_thread"))] async fn full_node_integration_test() { ``` with: ```bash error[E0728]: `await` is only allowed inside `async` functions and blocks --> triton_management_node/tests/triton_integration.rs:28:10 | 13 | #[serial(inner_attrs = [timeout(60_000)])] | ------------------------------------------ this is not `async` ... 28 | .await; | ^^^^^ only allowed inside `async` functions and blocks ``` Compiles: ```rust #[test_log::test(tokio::test)] #[serial(inner_attrs = [ntest::timeout(60_000)])] async fn full_node_integration_test() { ``` If I don't use `inner_attrs` then either order works and compiles. I suspect we're just running up against rough edges in the Rust attribute macro ecosystem and it is very challenging to get the four macros involved here to play together with each other correctly. I did want to flag for you to glance at as a possible regression? Maybe we could improve documentation to make it less likely for people to trip over? Maybe there is someway to improve this crate to handle this case, but might not be worth the effort.
关闭于 2026-05-30 3 条评论