fix(bench): Compiler 改带字段 struct 后 5 处 bench 用 new() 构造

04-03 将 Compiler 从 unit struct 改为带 enable_dce 字段后,
bench 里旧语法 'Compiler.compile(...)' 编译失败(clippy --all-targets
暴露,cargo test 不编 bench)。统一改 Compiler::new().compile(...)。
This commit is contained in:
爱特每羊队
2026-08-06 12:17:13 +08:00
parent 095e20cf84
commit ab66cb8283
5 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ fn bench_coercion(c: &mut Criterion) {
let js = "var x = \"42\"; var y = \"3.14\"; var r = 0; for (var i = 0; i < 5000; i++) { r += (+x) + (+y); } r";
let alloc = oxide_parser::Allocator::default();
let program = oxide_parser::parse(&alloc, js).expect("parse");
let module = Compiler.compile(&program).expect("compile");
let module = Compiler::new().compile(&program).expect("compile");
c.bench_function("coercion", |b| {
b.iter_batched(