{"record":{"id":"3ad6ddc502109b7d","repo":"zed-industries/zed","slug":"gpui-bench-sample-size-requires-inputs","errorCode":null,"errorMessage":"#[gpui::bench] `sample_size` requires `inputs`","messagePattern":"#\\[gpui::bench\\] `sample_size` requires `inputs`","errorType":"validation","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"crates/gpui_macros/src/bench.rs","lineNumber":126,"sourceCode":"            }\n            group.finish();\n            report.print(Some(stringify!(#outer_fn_name)));\n        }\n    } else {\n        if let Some(input_name) = input_name {\n            return error_to_stream(syn::Error::new(\n                input_name.span(),\n                \"#[gpui::bench] `input_name` requires `inputs`\",\n            ));\n        }\n        if let Some(group_name) = group_name {\n            return error_to_stream(syn::Error::new(\n                group_name.span(),\n                \"#[gpui::bench] `group` requires `inputs`\",\n            ));\n        }\n        if sample_size.is_some() {\n            return error_to_stream(syn::Error::new(\n                proc_macro2::Span::call_site(),\n                \"#[gpui::bench] `sample_size` requires `inputs`\",\n            ));\n        }\n        quote! {\n            let report = #report_expr;\n            criterion.bench_function(stringify!(#outer_fn_name), {\n                let report = report.clone();\n                move |bencher| {\n                    let mut cx = gpui::BenchAppContext::new_with_platform_and_report(\n                        gpui::bench_platform(\n                            Some(Box::new(|| {\n                                gpui_platform::current_headless_renderer()\n                            })),\n                            gpui_platform::current_platform(true).text_system(),\n                        ),\n                        Some(stringify!(#outer_fn_name)),\n                        bencher,","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/gpui_macros/src/bench.rs#L108-L144","documentation":"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.","triggerScenarios":"Thrown at crates/gpui_macros/src/bench.rs:126 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add the inputs = [...] argument to the attribute","Remove the sample_size option and rely on default sampling"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}