chore(warnings): sweep mechanical Rust warnings and drop blanket #[allow(unused_imports)]#6639
Conversation
📝 WalkthroughWalkthroughThis PR removes unused imports and warning suppressions, narrows internal re-exports, simplifies several local bindings, and adds focused helpers for method-name registration, global-property lowering, and omitted native-parameter padding. ChangesRepository-wide Rust cleanup
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
0ef5601 to
902f045
Compare
Drop 445 blanket #[allow(unused_imports)] across 86 host-buildable crates, prune the exposed dead imports with `cargo fix --all-targets`, and delete four dead bindings cargo fix could only underscore. Parent imports used solely by #[cfg(test)] sibling modules via `super::` are restored #[cfg(test)]-gated.
902f045 to
0b1835a
Compare
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
crates/perry-codegen/src/expr/property_get/globalget.rs (1)
83-133: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick winConsolidate duplicated lowering logic for built-in statics and native modules.
The manual lowering block for
"hasOwn"(lines 112-133) is identical to the logic performed bylower_global_builtin_static_value(ctx, "Object", property). You can safely remove this block and simply add"hasOwn"to thematches!list forObjectabove (lines 83-102).Similarly, consider reusing
lower_global_builtin_static_value(if its implementation is generic) or extracting a shared helper forError,ArrayBuffer,Uint8Array,SubtleCrypto, andMathto eliminate the extensive duplicated boilerplate. The same applies to the native module property lookups forconsoleandprocess, which share identical emission logic.♻️ Proposed fix to consolidate `"hasOwn"`
@@ -97,7 +97,8 @@ | "getOwnPropertyNames" | "getOwnPropertySymbols" | "getOwnPropertyDescriptors" - | "defineProperties" + | "defineProperties" + | "hasOwn" ) { return Ok(lower_global_builtin_static_value(ctx, "Object", property)); } - // `#3527`: `Object.hasOwn` read as a VALUE (not a direct call) — - // e.g. iconv-lite's merge-exports does - // `var hasOwn = typeof Object.hasOwn === "undefined" ? … : - // Object.hasOwn` then `hasOwn(obj, key)`. The ternary defeats - // the const-alias call-fold, so the value must be a real - // callable. Mirror the `Error.captureStackTrace` shape above: - // resolve the reified `Object` constructor closure and read the - // `hasOwn` static (installed by `install_builtin_constructor_statics`) - // off it, instead of falling through to the `0.0` sentinel. - if property == "hasOwn" { - let object_idx = ctx.strings.intern("Object"); - let object_bytes_global = format!("@{}", ctx.strings.entry(object_idx).bytes_global); - let object_len = "Object".len().to_string(); - let object_ctor = ctx.block().call( - DOUBLE, - "js_get_global_this_builtin_value", - &[(PTR, &object_bytes_global), (I64, &object_len)], - ); - let key_idx = ctx.strings.intern(property); - let key_handle_global = format!("@{}", ctx.strings.entry(key_idx).handle_global); - let blk = ctx.block(); - let ctor_handle = unbox_to_i64(blk, &object_ctor); - let key_box = blk.load(DOUBLE, &key_handle_global); - let key_bits = blk.bitcast_double_to_i64(&key_box); - let key_raw = blk.and(I64, &key_bits, POINTER_MASK_I64); - return Ok(blk.call( - DOUBLE, - "js_object_get_field_by_name_f64", - &[(I64, &ctor_handle), (I64, &key_raw)], - )); - }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@crates/perry-codegen/src/expr/property_get/globalget.rs` around lines 83 - 133, Consolidate the Object.hasOwn lowering by adding "hasOwn" to the existing Object static-property matches! list and removing the manual block that resolves the constructor and field. Reuse lower_global_builtin_static_value for this path, preserving the existing behavior while eliminating duplicated emission logic.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@crates/perry-codegen/src/expr/property_get/globalget.rs`:
- Around line 83-133: Consolidate the Object.hasOwn lowering by adding "hasOwn"
to the existing Object static-property matches! list and removing the manual
block that resolves the constructor and field. Reuse
lower_global_builtin_static_value for this path, preserving the existing
behavior while eliminating duplicated emission logic.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 84b76afc-8e5c-489f-9c0f-595ef665f3e6
📒 Files selected for processing (294)
crates/perry-codegen-wasm/src/emit/compile.rscrates/perry-codegen-wasm/src/emit/mod.rscrates/perry-codegen-wasm/src/emit/runtime_imports.rscrates/perry-codegen-wasm/src/emit/ui_method_map.rscrates/perry-codegen/src/codegen/boxed_locals.rscrates/perry-codegen/src/codegen/closure.rscrates/perry-codegen/src/codegen/closure_collect.rscrates/perry-codegen/src/codegen/func_registry.rscrates/perry-codegen/src/codegen/function.rscrates/perry-codegen/src/codegen/i64_spec.rscrates/perry-codegen/src/codegen/method_registry.rscrates/perry-codegen/src/codegen/mod.rscrates/perry-codegen/src/codegen/module_globals_emit.rscrates/perry-codegen/src/collectors/mod.rscrates/perry-codegen/src/expr/array_methods.rscrates/perry-codegen/src/expr/array_push.rscrates/perry-codegen/src/expr/arrays_finds.rscrates/perry-codegen/src/expr/bigint_set.rscrates/perry-codegen/src/expr/binary.rscrates/perry-codegen/src/expr/buffer_access.rscrates/perry-codegen/src/expr/call_spread.rscrates/perry-codegen/src/expr/calls.rscrates/perry-codegen/src/expr/calls/crypto_hash.rscrates/perry-codegen/src/expr/calls/crypto_kdf.rscrates/perry-codegen/src/expr/calls/crypto_keys.rscrates/perry-codegen/src/expr/calls/crypto_misc.rscrates/perry-codegen/src/expr/calls/fs.rscrates/perry-codegen/src/expr/calls/helpers.rscrates/perry-codegen/src/expr/child_proc.rscrates/perry-codegen/src/expr/closure.rscrates/perry-codegen/src/expr/compare.rscrates/perry-codegen/src/expr/conditional.rscrates/perry-codegen/src/expr/dispatch.rscrates/perry-codegen/src/expr/dyn_extern_i18n.rscrates/perry-codegen/src/expr/env_clones.rscrates/perry-codegen/src/expr/fs_await.rscrates/perry-codegen/src/expr/index_get.rscrates/perry-codegen/src/expr/index_set.rscrates/perry-codegen/src/expr/instance_misc1.rscrates/perry-codegen/src/expr/js_runtime.rscrates/perry-codegen/src/expr/literals_vars.rscrates/perry-codegen/src/expr/logical_collections.rscrates/perry-codegen/src/expr/math_simple.rscrates/perry-codegen/src/expr/misc_methods.rscrates/perry-codegen/src/expr/mod.rscrates/perry-codegen/src/expr/new_dynamic.rscrates/perry-codegen/src/expr/objects_arrays_lit.rscrates/perry-codegen/src/expr/os_uri_dates.rscrates/perry-codegen/src/expr/property_get.rscrates/perry-codegen/src/expr/property_get/generic_dispatch.rscrates/perry-codegen/src/expr/property_get/globalget.rscrates/perry-codegen/src/expr/property_get/helpers.rscrates/perry-codegen/src/expr/property_set.rscrates/perry-codegen/src/expr/proxy_reflect.rscrates/perry-codegen/src/expr/record_value.rscrates/perry-codegen/src/expr/shadow_slot.rscrates/perry-codegen/src/expr/static_field_meta.rscrates/perry-codegen/src/expr/static_method.rscrates/perry-codegen/src/expr/string_regex_proc.rscrates/perry-codegen/src/expr/super_method.rscrates/perry-codegen/src/expr/this_super_call.rscrates/perry-codegen/src/expr/unary.rscrates/perry-codegen/src/expr/url_main.rscrates/perry-codegen/src/lower_call/mod.rscrates/perry-codegen/src/lower_call/new.rscrates/perry-codegen/src/lower_call/omitted_native_params.rscrates/perry-codegen/src/lower_call/property_get.rscrates/perry-codegen/src/lower_call/property_get/dynamic_dispatch.rscrates/perry-codegen/src/lower_call/property_get/fetch_chain.rscrates/perry-codegen/src/lower_call/property_get/helpers.rscrates/perry-codegen/src/lower_call/property_get/map_set.rscrates/perry-codegen/src/lower_call/property_get/number_string.rscrates/perry-codegen/src/lower_call/property_get/promise_chain.rscrates/perry-codegen/src/lower_call/property_get/static_dispatch.rscrates/perry-codegen/src/native_value/verify.rscrates/perry-codegen/src/native_value/verify/abi.rscrates/perry-codegen/src/native_value/verify/layout.rscrates/perry-codegen/src/native_value/verify/raw_f64.rscrates/perry-codegen/src/runtime_decls/stdlib_ffi/data_stores.rscrates/perry-codegen/src/runtime_decls/stdlib_ffi/language_core.rscrates/perry-codegen/src/runtime_decls/stdlib_ffi/net_http.rscrates/perry-codegen/src/runtime_decls/stdlib_ffi/streams_events.rscrates/perry-codegen/src/runtime_decls/stdlib_ffi/third_party.rscrates/perry-codegen/src/runtime_decls/stdlib_ffi/utilities.rscrates/perry-codegen/src/runtime_decls/stdlib_ffi/web.rscrates/perry-codegen/src/type_analysis.rscrates/perry-codegen/src/type_analysis/numeric.rscrates/perry-codegen/src/type_analysis/pod.rscrates/perry-codegen/src/type_analysis/predicates.rscrates/perry-codegen/src/type_analysis/refine.rscrates/perry-codegen/src/type_analysis/strings.rscrates/perry-ext-http/src/lib.rscrates/perry-hir/src/destructuring/mod.rscrates/perry-hir/src/destructuring/var_decl/alias_tracking.rscrates/perry-hir/src/destructuring/var_decl/binding_guards.rscrates/perry-hir/src/destructuring/var_decl/native_fetch.rscrates/perry-hir/src/destructuring/var_decl/native_new.rscrates/perry-hir/src/destructuring/var_decl/type_infer.rscrates/perry-hir/src/lower/closure_analysis.rscrates/perry-hir/src/lower/context.rscrates/perry-hir/src/lower/decorators.rscrates/perry-hir/src/lower/expr_call/intrinsics.rscrates/perry-hir/src/lower/expr_call/intrinsics/apply_call.rscrates/perry-hir/src/lower/expr_call/intrinsics/bare_builtins.rscrates/perry-hir/src/lower/expr_call/intrinsics/eval_strict.rscrates/perry-hir/src/lower/expr_call/intrinsics/namespace_static.rscrates/perry-hir/src/lower/expr_call/intrinsics/native_arena.rscrates/perry-hir/src/lower/expr_call/intrinsics/precompile_wasm.rscrates/perry-hir/src/lower/expr_call/intrinsics/require.rscrates/perry-hir/src/lower/expr_member.rscrates/perry-hir/src/lower/expr_member/native_dispatch.rscrates/perry-hir/src/lower/expr_member/private_guard.rscrates/perry-hir/src/lower/expr_member/process_literals.rscrates/perry-hir/src/lower/expr_member/process_props.rscrates/perry-hir/src/lower/expr_member/stdlib_guard.rscrates/perry-hir/src/lower/expr_new.rscrates/perry-hir/src/lower/expr_new/helpers.rscrates/perry-hir/src/lower/expr_new/member.rscrates/perry-hir/src/lower/expr_new/non_ident.rscrates/perry-hir/src/lower/expr_object.rscrates/perry-hir/src/lower/lower_expr.rscrates/perry-hir/src/lower/lower_expr/arm_bin.rscrates/perry-hir/src/lower/lower_expr/arm_class.rscrates/perry-hir/src/lower/lower_expr/arm_ident.rscrates/perry-hir/src/lower/lower_expr/arm_optchain.rscrates/perry-hir/src/lower/lower_expr/arm_unary.rscrates/perry-hir/src/lower/lower_expr/assignment.rscrates/perry-hir/src/lower/lower_expr/helpers.rscrates/perry-hir/src/lower/lower_expr/reactive_text.rscrates/perry-hir/src/lower/misc.rscrates/perry-hir/src/lower/module_decl.rscrates/perry-hir/src/lower/module_decl/namespace.rscrates/perry-hir/src/lower/module_decl/native_default_import.rscrates/perry-hir/src/lower/pre_scan.rscrates/perry-hir/src/lower/shared_mutable_capture.rscrates/perry-hir/src/lower/stmt.rscrates/perry-hir/src/lower/template.rscrates/perry-hir/src/lower/widget_decl.rscrates/perry-hir/src/lower/widget_decl/reactive_animate.rscrates/perry-hir/src/lower_decl/block.rscrates/perry-hir/src/lower_decl/mod.rscrates/perry-hir/src/lower_types.rscrates/perry-hir/src/lower_types/extract.rscrates/perry-runtime/src/array/from_concat.rscrates/perry-runtime/src/buffer/header.rscrates/perry-runtime/src/buffer/mod.rscrates/perry-runtime/src/buffer/view.rscrates/perry-runtime/src/child_process/builder.rscrates/perry-runtime/src/child_process/emitter.rscrates/perry-runtime/src/child_process/exec.rscrates/perry-runtime/src/child_process/mod.rscrates/perry-runtime/src/child_process/options.rscrates/perry-runtime/src/child_process/output.rscrates/perry-runtime/src/child_process/registry.rscrates/perry-runtime/src/child_process/signals.rscrates/perry-runtime/src/child_process/value_util.rscrates/perry-runtime/src/closure/dispatch/bound.rscrates/perry-runtime/src/closure/dispatch/calln.rscrates/perry-runtime/src/closure/dispatch/errors.rscrates/perry-runtime/src/closure/dispatch/validate.rscrates/perry-runtime/src/closure/dispatch/value_call.rscrates/perry-runtime/src/dgram.rscrates/perry-runtime/src/dgram/ffi.rscrates/perry-runtime/src/dgram/listeners.rscrates/perry-runtime/src/dgram/net.rscrates/perry-runtime/src/dgram/ops.rscrates/perry-runtime/src/dgram/thunks.rscrates/perry-runtime/src/dns.rscrates/perry-runtime/src/dns/ffi.rscrates/perry-runtime/src/dns/records.rscrates/perry-runtime/src/dns/resolve_build.rscrates/perry-runtime/src/fs/dir_glob_watch.rscrates/perry-runtime/src/fs/dir_glob_watch/glob.rscrates/perry-runtime/src/fs/dir_glob_watch/opendir.rscrates/perry-runtime/src/fs/dir_glob_watch/watch.rscrates/perry-runtime/src/fs/errors.rscrates/perry-runtime/src/fs/fd_sync_ops.rscrates/perry-runtime/src/fs/mod.rscrates/perry-runtime/src/gc/copying.rscrates/perry-runtime/src/gc/cycle.rscrates/perry-runtime/src/gc/mod.rscrates/perry-runtime/src/gc/tests/triggers.rscrates/perry-runtime/src/intl.rscrates/perry-runtime/src/intl/date_collator.rscrates/perry-runtime/src/intl/list_relative_plural.rscrates/perry-runtime/src/intl/number_format.rscrates/perry-runtime/src/intl/number_format_options.rscrates/perry-runtime/src/intl/segmenter.rscrates/perry-runtime/src/json/mod.rscrates/perry-runtime/src/json/replacer.rscrates/perry-runtime/src/json/stringify.rscrates/perry-runtime/src/json/stringify_scalars.rscrates/perry-runtime/src/json/stringify_tojson_probe.rscrates/perry-runtime/src/map.rscrates/perry-runtime/src/node_stream_compose_live.rscrates/perry-runtime/src/node_stream_constructors.rscrates/perry-runtime/src/node_stream_constructors/builders.rscrates/perry-runtime/src/node_stream_constructors/introspection.rscrates/perry-runtime/src/node_stream_constructors/pipeline.rscrates/perry-runtime/src/node_stream_constructors/web_adapter.rscrates/perry-runtime/src/node_stream_dispatch.rscrates/perry-runtime/src/node_stream_duplex_methods.rscrates/perry-runtime/src/node_stream_iter_helpers.rscrates/perry-runtime/src/node_stream_json.rscrates/perry-runtime/src/node_stream_keys.rscrates/perry-runtime/src/node_stream_pipeline.rscrates/perry-runtime/src/node_stream_readwrite.rscrates/perry-runtime/src/object/class_meta_registry.rscrates/perry-runtime/src/object/class_registry.rscrates/perry-runtime/src/object/class_registry/class_meta.rscrates/perry-runtime/src/object/class_registry/construct.rscrates/perry-runtime/src/object/class_registry/dispatch.rscrates/perry-runtime/src/object/class_registry/gc_roots.rscrates/perry-runtime/src/object/class_registry/parent_static.rscrates/perry-runtime/src/object/class_registry/prototype_methods.rscrates/perry-runtime/src/object/class_registry/prototype_objects.rscrates/perry-runtime/src/object/class_registry/registration.rscrates/perry-runtime/src/object/class_registry/state.rscrates/perry-runtime/src/object/descriptor_state.rscrates/perry-runtime/src/object/field_get_set.rscrates/perry-runtime/src/object/global_this.rscrates/perry-runtime/src/object/global_this/bigint_promise.rscrates/perry-runtime/src/object/global_this/builtin_thunks.rscrates/perry-runtime/src/object/mod.rscrates/perry-runtime/src/object/native_call_method/collection_methods.rscrates/perry-runtime/src/object/native_call_method/common_methods.rscrates/perry-runtime/src/object/native_call_method/disposal.rscrates/perry-runtime/src/object/native_call_method/handle_methods.rscrates/perry-runtime/src/object/native_call_method/object_proto.rscrates/perry-runtime/src/object/native_call_method/primitive_methods.rscrates/perry-runtime/src/object/native_call_method/proto_dispatch.rscrates/perry-runtime/src/object/native_call_method/string_methods.rscrates/perry-runtime/src/object/native_call_method/typed_array.rscrates/perry-runtime/src/object/native_module.rscrates/perry-runtime/src/object/native_module/callable_export_check.rscrates/perry-runtime/src/object/native_module/callable_exports.rscrates/perry-runtime/src/object/native_module/constants.rscrates/perry-runtime/src/object/native_module/module_keys.rscrates/perry-runtime/src/object/native_module/namespace_builders.rscrates/perry-runtime/src/object/native_module/web_locks.rscrates/perry-runtime/src/object/object_ops.rscrates/perry-runtime/src/object/object_ops/define_properties.rscrates/perry-runtime/src/object/this_binding.rscrates/perry-runtime/src/object/to_string_tag.rscrates/perry-runtime/src/process.rscrates/perry-runtime/src/process/env_misc.rscrates/perry-runtime/src/process/finalization.rscrates/perry-runtime/src/process/node_module.rscrates/perry-runtime/src/process/permission.rscrates/perry-runtime/src/process/report.rscrates/perry-runtime/src/promise/then.rscrates/perry-runtime/src/proxy/reflect_misc.rscrates/perry-runtime/src/regex/exec.rscrates/perry-runtime/src/regex/match_string.rscrates/perry-runtime/src/symbol.rscrates/perry-runtime/src/symbol/constructors.rscrates/perry-runtime/src/symbol/gc_roots.rscrates/perry-runtime/src/symbol/get.rscrates/perry-runtime/src/symbol/iterator.rscrates/perry-runtime/src/symbol/properties.rscrates/perry-runtime/src/temporal/plain_date_time.rscrates/perry-runtime/src/temporal/plain_time.rscrates/perry-runtime/src/temporal/plain_year_month.rscrates/perry-runtime/src/typedarray/access.rscrates/perry-runtime/src/typedarray/construct.rscrates/perry-runtime/src/typedarray/iterate.rscrates/perry-runtime/src/typedarray/mod.rscrates/perry-runtime/src/typedarray/slice_ops.rscrates/perry-runtime/src/typedarray/transform.rscrates/perry-runtime/src/url/node_compat.rscrates/perry-stdlib/src/common/dispatch.rscrates/perry-stdlib/src/common/dispatch/fastify_net_zlib.rscrates/perry-stdlib/src/common/dispatch/init.rscrates/perry-stdlib/src/common/dispatch/sqlite.rscrates/perry-stdlib/src/crypto.rscrates/perry-stdlib/src/events.rscrates/perry-stdlib/src/events/events_on.rscrates/perry-stdlib/src/events/module_helpers.rscrates/perry-stdlib/src/events/once_helpers.rscrates/perry-stdlib/src/framework/multipart.rscrates/perry-stdlib/src/sqlite.rscrates/perry-stdlib/src/sqlite/backup.rscrates/perry-stdlib/src/sqlite/better.rscrates/perry-stdlib/src/sqlite/bind.rscrates/perry-stdlib/src/sqlite/connection.rscrates/perry-stdlib/src/sqlite/dispatch.rscrates/perry-stdlib/src/sqlite/node_db.rscrates/perry-stdlib/src/sqlite/node_stmt_session.rscrates/perry-stdlib/src/sqlite/node_tag_store.rscrates/perry-stdlib/src/sqlite/options.rscrates/perry-stdlib/src/webcrypto.rscrates/perry/src/commands/compile/cjs_wrap/detect.rscrates/perry/src/commands/compile/cjs_wrap/extract_requires.rscrates/perry/src/commands/compile/cjs_wrap/hoist_classes.rs
💤 Files with no reviewable changes (91)
- crates/perry-codegen-wasm/src/emit/runtime_imports.rs
- crates/perry-codegen/src/codegen/i64_spec.rs
- crates/perry-codegen/src/codegen/boxed_locals.rs
- crates/perry-runtime/src/fs/errors.rs
- crates/perry-runtime/src/object/native_call_method/common_methods.rs
- crates/perry-codegen-wasm/src/emit/ui_method_map.rs
- crates/perry-stdlib/src/common/dispatch/sqlite.rs
- crates/perry-codegen/src/codegen/closure.rs
- crates/perry-runtime/src/closure/dispatch/validate.rs
- crates/perry-runtime/src/typedarray/slice_ops.rs
- crates/perry-runtime/src/buffer/header.rs
- crates/perry-hir/src/lower/expr_member/stdlib_guard.rs
- crates/perry-runtime/src/node_stream_duplex_methods.rs
- crates/perry-runtime/src/typedarray/transform.rs
- crates/perry-runtime/src/object/native_module/web_locks.rs
- crates/perry-runtime/src/closure/dispatch/bound.rs
- crates/perry-runtime/src/closure/dispatch/calln.rs
- crates/perry-runtime/src/object/native_call_method/handle_methods.rs
- crates/perry-runtime/src/object/class_registry/prototype_methods.rs
- crates/perry-runtime/src/object/native_call_method/string_methods.rs
- crates/perry-runtime/src/object/native_call_method/proto_dispatch.rs
- crates/perry-stdlib/src/common/dispatch/fastify_net_zlib.rs
- crates/perry-runtime/src/node_stream_compose_live.rs
- crates/perry-runtime/src/closure/dispatch/errors.rs
- crates/perry-hir/src/lower/expr_member/process_literals.rs
- crates/perry-runtime/src/node_stream_json.rs
- crates/perry-runtime/src/buffer/view.rs
- crates/perry-runtime/src/typedarray/mod.rs
- crates/perry-runtime/src/object/native_call_method/primitive_methods.rs
- crates/perry/src/commands/compile/cjs_wrap/extract_requires.rs
- crates/perry-codegen/src/codegen/func_registry.rs
- crates/perry-runtime/src/object/native_call_method/object_proto.rs
- crates/perry-runtime/src/process/env_misc.rs
- crates/perry-runtime/src/node_stream_constructors.rs
- crates/perry-runtime/src/object/class_registry/state.rs
- crates/perry-runtime/src/object/native_call_method/collection_methods.rs
- crates/perry-runtime/src/object/global_this/builtin_thunks.rs
- crates/perry-runtime/src/regex/exec.rs
- crates/perry-runtime/src/symbol/gc_roots.rs
- crates/perry-stdlib/src/common/dispatch/init.rs
- crates/perry-runtime/src/node_stream_keys.rs
- crates/perry-runtime/src/object/class_registry/class_meta.rs
- crates/perry-runtime/src/typedarray/iterate.rs
- crates/perry-runtime/src/json/stringify_scalars.rs
- crates/perry-hir/src/lower_decl/mod.rs
- crates/perry-stdlib/src/common/dispatch.rs
- crates/perry-runtime/src/object/class_registry/gc_roots.rs
- crates/perry-runtime/src/object/native_call_method/typed_array.rs
- crates/perry-runtime/src/fs/dir_glob_watch/watch.rs
- crates/perry-runtime/src/json/stringify.rs
- crates/perry-runtime/src/child_process/signals.rs
- crates/perry-codegen-wasm/src/emit/mod.rs
- crates/perry-hir/src/lower/lower_expr/assignment.rs
- crates/perry-runtime/src/proxy/reflect_misc.rs
- crates/perry-runtime/src/closure/dispatch/value_call.rs
- crates/perry-runtime/src/process.rs
- crates/perry-runtime/src/buffer/mod.rs
- crates/perry-hir/src/lower/lower_expr/reactive_text.rs
- crates/perry-runtime/src/object/class_meta_registry.rs
- crates/perry/src/commands/compile/cjs_wrap/detect.rs
- crates/perry-hir/src/lower/expr_member/native_dispatch.rs
- crates/perry-runtime/src/process/permission.rs
- crates/perry-runtime/src/object/global_this/bigint_promise.rs
- crates/perry/src/commands/compile/cjs_wrap/hoist_classes.rs
- crates/perry-runtime/src/process/report.rs
- crates/perry-runtime/src/object/native_module/callable_export_check.rs
- crates/perry-runtime/src/regex/match_string.rs
- crates/perry-codegen-wasm/src/emit/compile.rs
- crates/perry-runtime/src/object/native_call_method/disposal.rs
- crates/perry-hir/src/lower/pre_scan.rs
- crates/perry-hir/src/lower/lower_expr/arm_bin.rs
- crates/perry-runtime/src/typedarray/construct.rs
- crates/perry-runtime/src/map.rs
- crates/perry-codegen/src/type_analysis/numeric.rs
- crates/perry-runtime/src/promise/then.rs
- crates/perry-hir/src/lower/expr_member.rs
- crates/perry-hir/src/lower/widget_decl.rs
- crates/perry-runtime/src/object/object_ops/define_properties.rs
- crates/perry-runtime/src/symbol/iterator.rs
- crates/perry-runtime/src/dgram/ffi.rs
- crates/perry-runtime/src/object/to_string_tag.rs
- crates/perry-runtime/src/fs/dir_glob_watch/opendir.rs
- crates/perry-runtime/src/gc/tests/triggers.rs
- crates/perry-ext-http/src/lib.rs
- crates/perry-runtime/src/typedarray/access.rs
- crates/perry-runtime/src/object/native_module/module_keys.rs
- crates/perry-hir/src/lower/module_decl/native_default_import.rs
- crates/perry-runtime/src/json/replacer.rs
- crates/perry-runtime/src/process/finalization.rs
- crates/perry-hir/src/lower/expr_call/intrinsics.rs
- crates/perry-hir/src/lower/expr_new/non_ident.rs
Summary
Mechanical Rust warning cleanup across the workspace — no behavioral change. This is the first, zero-risk slice of a larger warning-elimination effort (the workspace currently emits ~1338 warnings on a clean
cargo check); it clears the fully mechanical categories and the blanket import-suppression debt.Two commits:
cargo fixmechanical sweep — removes unused imports, unnecessaryunsafeblocks, unusedmut/braces, and unused assignments.cargo fixhandles most of these;unused_unsafeis applied by a span-driven pass because rustc emits that lint without a machine-applicable suggestion (removing an unnecessaryunsafeblock is safe by definition — if it were needed, it would not be flagged).Drop 444 blanket
#[allow(unused_imports)]and prune — these attributes papered over duplicated import preambles in mechanically-split files. Removing them and re-runningcargo fixprunes the now-visible unused imports. The warning count does not rise afterward, confirming the suppressed imports were all genuinely removable. Two documented, intentional allows remain.Impact
#[allow(unused_imports)]: 444 → 2 (both remaining are documented and deliberate).Validation
cargo check --workspace(excluding cross-host UI crates): 0 errors.cargo fmt --all --check: clean.cargo check --workspace --tests: no new errors from this change (the one pre-existing failure — a staleCompileOptionsfield reference inperry-codegen/tests/perry_builtin_name_collision.rs— is unrelated and already present onmain).Notes
Summary by CodeRabbit