Skip to content

♻️ refactor(mq-lang): improve error messages#1472

Merged
harehare merged 2 commits intomainfrom
refactor/improve-error-messages
Mar 19, 2026
Merged

♻️ refactor(mq-lang): improve error messages#1472
harehare merged 2 commits intomainfrom
refactor/improve-error-messages

Conversation

@harehare
Copy link
Copy Markdown
Owner

No description provided.

- Use human-readable error codes (mq::runtime, mq::syntax, mq::module)
  instead of type names derived via std::any::type_name
- Show type names (e.g. "number", "string") instead of debug-formatted
  values in InvalidTypes errors
- Improve help text across runtime and syntax errors for clarity
- Remove MacroParamsMustBeIdents variant (no longer needed)
- Update rust-toolchain to 1.94.0
- Update tests to match new InvalidTypes error format
Copilot AI review requested due to automatic review settings March 19, 2026 10:57
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors mq-lang diagnostics to provide clearer, more user-friendly error messages and categorization, while also updating the repository’s pinned Rust toolchain version.

Changes:

  • Bump pinned Rust toolchain from 1.93.0 to 1.94.0.
  • Improve runtime “invalid types” reporting to emit type names (e.g., number, string) instead of value debug strings, and update evaluator tests accordingly.
  • Enhance syntax/runtime/module diagnostics (wording, help text, labels, and diagnostic codes) and add targeted tests.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
rust-toolchain.toml Updates the pinned Rust toolchain channel to 1.94.0.
crates/mq-lang/src/eval/builtin.rs Changes invalid-type argument reporting to use runtime value type names.
crates/mq-lang/src/eval.rs Updates eval tests to match the new invalid-type argument formatting.
crates/mq-lang/src/error/syntax.rs Refines syntax error messages (including adding line/column context to many variants) and removes an unused variant.
crates/mq-lang/src/error/runtime.rs Tweaks several runtime error strings for clarity/consistency.
crates/mq-lang/src/error.rs Reworks diagnostic code(), improves help text/labels, and adds tests for the new behavior.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 19, 2026

Merging this PR will not alter performance

✅ 29 untouched benchmarks


Comparing refactor/improve-error-messages (c7b6f3b) with main (aea204a)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (860741a) during the generation of this report, so aea204a was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@harehare harehare merged commit 5b46ba4 into main Mar 19, 2026
6 checks passed
@harehare harehare deleted the refactor/improve-error-messages branch March 19, 2026 12:45
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