Skip to content

fix(divan): bump proc-macro-crate to parse multiline inline tables#185

Merged
GuillaumeLagrange merged 1 commit into
mainfrom
cod-3022-codspeed-macro-fails-to-parse-multiline-inline-table-in
Jun 26, 2026
Merged

fix(divan): bump proc-macro-crate to parse multiline inline tables#185
GuillaumeLagrange merged 1 commit into
mainfrom
cod-3022-codspeed-macro-fails-to-parse-multiline-inline-table-in

Conversation

@GuillaumeLagrange

Copy link
Copy Markdown
Contributor

Bump proc-macro-crate from 3.2.0 to 3.5.0 in the divan compat macros crate so that the bench macro can parse consumer manifests that use multiline inline tables.

The divan::bench macro resolves the (often renamed) codspeed-divan-compat dependency by calling proc_macro_crate::crate_name, which parses the consumer's Cargo.toml with toml_edit. proc-macro-crate 3.2.0 pulled toml_edit 0.22, which parses in strict TOML 1.0 mode and rejects multiline inline tables — a TOML 1.1 feature that Cargo itself accepts. When a manifest contained one (e.g. a long features = [...] list wrapped across lines by a formatter), parsing failed, the rename could not be resolved, and the macro silently fell back to the unrenamed codspeed_divan_compat path, producing:

error[E0433]: cannot find `codspeed_divan_compat` in the crate root

proc-macro-crate 3.5.0 depends on toml_edit 0.25 (+spec-1.1.0), which parses multiline inline tables, so the rename resolves correctly.

This surfaced from a real user report (biome): after a CI formatter rewrapped a dependency in biome_module_graph/Cargo.toml into a multiline inline table, their divan benchmarks stopped compiling. Reproduced the exact E0433 with proc-macro-crate 3.2.0 / toml_edit 0.22 against that manifest shape, and confirmed it compiles cleanly with 3.5.0 / toml_edit 0.25.

The crate's MSRV is raised 1.80 → 1.85 to match the rest of the workspace (proc-macro-crate 3.5.0 requires 1.82, and the parent codspeed-divan-compat lib is already 1.85, so this is not a consumer-facing bump). The CI msrv-check job for divan_compat passes at 1.85.

Closes COD-3022

The bench macro resolves the renamed `codspeed-divan-compat` dependency
via `proc_macro_crate::crate_name`, which parses the consumer's
Cargo.toml with toml_edit. proc-macro-crate 3.2.0 pulled toml_edit
0.22, which parses in strict TOML 1.0 mode and rejects multiline inline
tables. When a manifest contained one (e.g. a formatter-wrapped
`features = [...]` list), parsing failed, the rename could not be
resolved, and the macro fell back to the unrenamed `codspeed_divan_compat`
path, producing `E0433: cannot find codspeed_divan_compat in the crate
root`.

Bump to proc-macro-crate 3.5.0, which depends on toml_edit 0.25 with
TOML 1.1 support, so multiline inline tables parse and the rename
resolves correctly. Raise the crate MSRV to 1.85 to match the rest of
the workspace (proc-macro-crate 3.5.0 requires 1.82).

Closes COD-3022
Co-Authored-By: Claude <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Jun 26, 2026

Copy link
Copy Markdown

Greptile Summary

This PR updates the Divan compatibility macro dependency used to resolve renamed crates.

  • Bumps proc-macro-crate from 3.2.0 to 3.5.0.
  • Updates the lockfile for the newer TOML parser dependency stack.
  • Raises the macros crate rust-version from 1.80 to 1.85.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
crates/divan_compat/macros/Cargo.toml Raises the macros crate MSRV and updates proc-macro-crate for TOML 1.1-compatible manifest parsing.
Cargo.lock Refreshes locked transitive packages for the proc-macro-crate upgrade while keeping older TOML packages needed elsewhere.

Reviews (1): Last reviewed commit: "fix(divan): bump proc-macro-crate to par..." | Re-trigger Greptile

@codspeed-hq

codspeed-hq Bot commented Jun 26, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 11 improved benchmarks
❌ 6 regressed benchmarks
✅ 574 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
WallTime iterative[0] 1 ns 9 ns -88.89%
WallTime init_array[42] 37 ns 62 ns -40.32%
Simulation iterative[0] 119.2 ns 148.3 ns -19.66%
WallTime hamiltonian_cycle[7] 1 µs 1.3 µs -17.39%
WallTime iter_with_setup 48 ns 52 ns -7.69%
WallTime bench_array1[42] 36 ns 38 ns -5.26%
WallTime instant 23 ns 12 ns +91.67%
WallTime string_processing_multi_counter 682 ns 384 ns +77.6%
WallTime count_set_bits[0] 10 ns 7 ns +42.86%
Simulation count_set_bits[0] 119.2 ns 90 ns +32.41%
Simulation count_set_bits[1024] 121.1 ns 91.9 ns +31.72%
Simulation count_set_bits[42] 123.9 ns 94.7 ns +30.79%
Simulation count_set_bits[255] 130.8 ns 101.7 ns +28.69%
Simulation count_set_bits[65535] 141.9 ns 112.8 ns +25.86%
WallTime add_two_integers[(255, 255)] 21 ns 19 ns +10.53%
WallTime add_two_integers[(42, 13)] 20 ns 19 ns +5.26%
Simulation string_copy_with_bytes_counter 915.6 ns 886.4 ns +3.29%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing cod-3022-codspeed-macro-fails-to-parse-multiline-inline-table-in (9229680) with main (9339a52)

Open in CodSpeed

@GuillaumeLagrange GuillaumeLagrange merged commit 9229680 into main Jun 26, 2026
87 of 91 checks passed
@GuillaumeLagrange GuillaumeLagrange deleted the cod-3022-codspeed-macro-fails-to-parse-multiline-inline-table-in branch June 26, 2026 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants