Skip to content

Commit 2ad3778

Browse files
committed
Add context
1 parent 416a071 commit 2ad3778

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

text/0000-erfc-post-build-contexts.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,18 +77,23 @@ called `mytest`:
7777

7878
```rust
7979
extern crate proc_macro;
80-
use proc_macro::TokenStream;
80+
use proc_macro::{TestFrameworkContext, TokenStream};
8181

8282
// attributes() is optional
8383
#[test_framework(attributes(foo, bar))]
84-
pub fn mytest(items: &[AnnotatedItem]) -> TokenStream {
84+
pub fn mytest(context: &TestFrameworkContext) -> TokenStream {
8585
// ...
8686
}
8787
```
8888

8989
where
9090

9191
```rust
92+
struct TestFrameworkContext<'a> {
93+
items: &'a [AnnotatedItem],
94+
// ... (may be added in the future)
95+
}
96+
9297
struct AnnotatedItem
9398
tokens: TokenStream,
9499
span: Span,

0 commit comments

Comments
 (0)