Skip to content

chore: reduce compile warnings (325 → 125)#857

Merged
TheHypnoo merged 4 commits into
mainfrom
chore/reduce-compile-warnings
May 16, 2026
Merged

chore: reduce compile warnings (325 → 125)#857
TheHypnoo merged 4 commits into
mainfrom
chore/reduce-compile-warnings

Conversation

@TheHypnoo
Copy link
Copy Markdown
Contributor

Summary

Reduces cargo build --release warnings from 325 → 125 (−62%) across the workspace. All changes are mechanical lint cleanup with zero behavior change. Verified by the full library test suite and a smoke compile.

Changes

Category Count What changed
unnecessary unsafe block 168 Removed redundant unsafe { ... } wrappers around calls to FFI helpers that are declared pub extern "C" fn (not unsafe fn), so the wrapper was a no-op.
unused import 6 Removed unused HashMap / HashSet / paint / perry_hir::Expr / etc.
#[inline] ignored on extern "C" 6 Removed #[inline] from #[no_mangle] pub extern "C" fn … — rustc ignores it on externally exported functions, so the attribute was misleading.
variable does not need to be mutable 5 Dropped redundant mut bindings.
Snake-case naming 3 Renamed has_user_toStringhas_user_to_string (local variable in lower_call.rs).
unused doc comment 9 Converted /// to // for comment blocks placed before thread_local! / macro invocations — rustdoc does not generate docs for macro outputs.

Out of scope (tracked in follow-up issues)

The remaining 125 warnings need per-site judgment and were carved out:

Test plan

  • cargo build --release — 0 errors, 125 warnings (was 325)
  • cargo test --release --workspace --lib (excluding cross-host UI crates) — all pass, including 250 in perry-runtime
  • Smoke compile of a TS file exercising arrays, objects, JSON, Map, Set, async/await — output matches Node

TheHypnoo and others added 3 commits May 16, 2026 12:53
All mechanical lint cleanup, zero behavior change. Verified by
`cargo test --release --workspace --lib` (incl. 250 perry-runtime
tests) and a smoke compile of a TS file exercising arrays, objects,
JSON, Map, Set, and async/await.

Categories addressed:
- 168 × unnecessary `unsafe` block: removed redundant `unsafe { ... }`
  wrappers around calls to FFI helpers that are declared
  `pub extern "C" fn` (not `unsafe fn`), so the wrapper was a no-op.
- 6 × unused import: HashMap/HashSet/paint/perry_hir::Expr/etc.
- 6 × #[inline] ignored on extern "C": rustc ignores `#[inline]` on
  `#[no_mangle] pub extern "C" fn`, so the attribute was misleading.
- 5 × variable does not need to be mutable: dropped redundant `mut`.
- 3 × snake-case naming: `has_user_toString` → `has_user_to_string`
  (local variable in lower_call.rs).
- 9 × unused doc comment: converted `///` to `//` for comment blocks
  placed before `thread_local!` / macro invocations — rustdoc does
  not generate docs for macro outputs.

The remaining 125 warnings need per-site judgment and are tracked
in follow-up issues (unreachable patterns, dead code triage, Rust
2024 compat, _setjmp signature mismatch).
@proggeramlug
Copy link
Copy Markdown
Contributor

This is a great one, love it!

…warnings

# Conflicts:
#	crates/perry-runtime/src/builtins.rs
#	crates/perry-runtime/src/timer.rs
@TheHypnoo TheHypnoo merged commit 4068fb6 into main May 16, 2026
9 checks passed
@TheHypnoo TheHypnoo deleted the chore/reduce-compile-warnings branch May 16, 2026 12:22
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