zed-industries/zed · error · syn::Error
#[gpui::bench] `sample_size` requires `inputs`
Error message
#[gpui::bench] `sample_size` requires `inputs`
What it means
Compile-time configuration error in #[gpui::bench]: sample_size tunes per-input sampling, which only applies when the inputs list is present. The macro rejects sample_size on a single-input benchmark.
Source
Thrown at crates/gpui_macros/src/bench.rs:126
}
group.finish();
report.print(Some(stringify!(#outer_fn_name)));
}
} else {
if let Some(input_name) = input_name {
return error_to_stream(syn::Error::new(
input_name.span(),
"#[gpui::bench] `input_name` requires `inputs`",
));
}
if let Some(group_name) = group_name {
return error_to_stream(syn::Error::new(
group_name.span(),
"#[gpui::bench] `group` requires `inputs`",
));
}
if sample_size.is_some() {
return error_to_stream(syn::Error::new(
proc_macro2::Span::call_site(),
"#[gpui::bench] `sample_size` requires `inputs`",
));
}
quote! {
let report = #report_expr;
criterion.bench_function(stringify!(#outer_fn_name), {
let report = report.clone();
move |bencher| {
let mut cx = gpui::BenchAppContext::new_with_platform_and_report(
gpui::bench_platform(
Some(Box::new(|| {
gpui_platform::current_headless_renderer()
})),
gpui_platform::current_platform(true).text_system(),
),
Some(stringify!(#outer_fn_name)),
bencher,View on GitHub (pinned to f4178619ac)
Solutions
- Add the inputs = [...] argument to the attribute
- Remove the sample_size option and rely on default sampling
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at crates/gpui_macros/src/bench.rs:126 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20).
Data as JSON: /api/errors/3ad6ddc502109b7d.
Report an issue: GitHub.