Open
Description
The current #[bench]
attribute is broken because #7 was merged without testing.
code:
#![feature(test)]
extern crate test;
use async_std::task;
#[async_attributes::bench]
async fn bench(b: &mut test::Bencher) {
b.iter(|| {
println!("hello world");
})
}
error:
error: macros that expand to items must be delimited with braces or followed by a semicolon
--> benches/bench.rs:7:16
|
7 | async fn bench(b: &mut test::Bencher) {
| ^^^^^^^^^^^^^^^^^^^^^
help: change the delimiters to curly braces
|
7 | async fn bench( {: &mut test::Benche}) {
| ^ ^
help: add a semicolon
|
7 | async fn bench(b: &mut test::Bencher;) {
| ^
error: macro expansion ignores token `,` and any following
--> benches/bench.rs:7:16
|
6 | #[async_attributes::bench]
| -------------------------- caused by the macro expansion here
7 | async fn bench(b: &mut test::Bencher) {
| ^^^^^^^^^^^^^^^^^^^^^
|
= note: the usage of `async_attributes::bench!` is likely invalid in item context
error: async benchmarks don't take any arguments
--> benches/bench.rs:7:16
|
7 | async fn bench(b: &mut test::Bencher) {
| ^^^^^^^^^^^^^^^^^^^^^
Metadata
Metadata
Assignees
Labels
No labels