Skip to content

refactor: consolidate module checks, optimize lookups, fix clippy lints#261

Merged
EmNudge merged 1 commit intomainfrom
refactor-consolidate-module-checks
Feb 26, 2026
Merged

refactor: consolidate module checks, optimize lookups, fix clippy lints#261
EmNudge merged 1 commit intomainfrom
refactor-consolidate-module-checks

Conversation

@EmNudge
Copy link
Owner

@EmNudge EmNudge commented Feb 26, 2026

Summary

  • Replace CONST_INSTRUCTIONS linear scan with matches!() for O(1) const expression validation
  • Extract validate_const_instr() helper to de-duplicate instr_plain/expr1_plain validation
  • Use HashMap entry API instead of contains_key + insert (3 call sites)
  • Bundle 6 identifier HashMaps into IdentifierMaps struct, removing too_many_arguments lint
  • Replace BLOCK_KINDS_* array lookups with matches!() and remove unused constants
  • Use find_param_in_function/find_local_in_function/find_block_in_function helpers in references_core
  • Fix clippy needless-pass-by-value in wat-bench and wat-docs

@EmNudge EmNudge force-pushed the refactor-consolidate-module-checks branch from 8fc0cab to e897f83 Compare February 26, 2026 03:22
@github-actions
Copy link

github-actions bot commented Feb 26, 2026

Docs Preview

Deployed to Cloudflare Pages:
https://3b453403.wat-docs.pages.dev (e897f83411db8ff8be6452b5ae07bf53c7ed5d01)

Playground

WAST Spec Test Progress

Category Base PR Delta
Total pass 6040 6040
Total fail 6 6
Total skip 58577 58577
Valid modules 2127/2128 2127/2128
assert_invalid 2684/2689 2684/2689
assert_malformed 1229/1229 1229/1229

@EmNudge EmNudge merged commit 7206818 into main Feb 26, 2026
28 checks passed
@EmNudge EmNudge deleted the refactor-consolidate-module-checks branch February 26, 2026 03:31
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.

1 participant