Skip to content

Web app: clippy for wasm stops at a drop of a File in safe_write.rs, and 12 other warnings only that target shows #12222

Closed

Description

@CamWight

Running clippy for the web app's target stops at an error on main, and 12 more warnings show up only on that target. CI never sees either: its wasm step is a cargo check, not clippy. So every PR that runs clippy for wasm by hand reports the same lines as "already on main". About a dozen have done so since October: #1908, #1917, #4054, #4635, #5350, #5499, #6253, #6670, #6696, #7564, #7565, #8125 and #9654.

Reproduce

On main 9c93a6c, rustc and clippy 1.98.0:

cargo clippy -p solidcraft-web --target wasm32-unknown-unknown --profile ci -- -D warnings
error: call to `std::mem::drop` with a value that does not implement `Drop`. Dropping such a type only extends its contained lifetimes
   --> crates\io\src\safe_write.rs:298:5
    |
298 |     drop(file);
    |     ^^^^^^^^^^
    |
note: argument has type `std::fs::File`
   --> crates\io\src\safe_write.rs:298:10
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#drop_non_drop
    = note: `-D clippy::drop-non-drop` implied by `-D warnings`

error: could not compile `solidcraft-io` (lib) due to 1 previous error

On wasm32, std::fs::File is a stub with no Drop, so clippy's drop_non_drop fires. The line is in create_atomic, after its if cfg!(target_arch = "wasm32") { ... return } branch: the native path still compiles on wasm. The line moved over time (146, 162, 189, now 298), but the drop(file) is the same one, from #863.

The other warnings (same command, without -D warnings)

Without -D warnings clippy doesn't stop at solidcraft-io. It reports these, for wasm only (main 9c93a6c):

Where Warning
crates/io/src/safe_write.rs:298 drop of a value with no Drop (the File above)
crates/engine/src/control_auth.rs:310 drop of a value with no Drop
crates/engine/src/cmd/file_easyprint.rs:21 field bodies is never read
crates/engine/src/cmd/sketch_drag.rs:42 constant AHEAD is never used
crates/ui-egui/src/dialogs_library.rs:2 unused import crate::dialogs_appearance::selected_params
crates/ui-egui/src/file_load.rs:15 unused import solidcraft_engine::geom::prelude
crates/ui-egui/src/home.rs:565 unused variable ctx
crates/ui-egui/src/browser/point_cloud_tracks.rs:124 field asked is never read
crates/ui-egui/src/deferred.rs:80 variant Later is never constructed
crates/ui-egui/src/lib.rs:3079 a let-binding with unit value
apps/solidcraft-web/src/files.rs:679 useless conversion to JsValue
apps/solidcraft-web/src/install.rs:26, 28 useless conversion to JsValue (two)

Thirteen in all: the error above and 12 more.

Most are code that only native builds use: an import, a field or a constant that a #[cfg(not(target_arch = "wasm32"))] path reads.

What would fix it

  • Each line gets its own wasm-only fix: the native-only code behind cfg, or drop(file) replaced by the file going out of scope.
  • So that it stays fixed, CI's wasm job (or cargo xtask wasm) could run clippy with -D warnings instead of, or after, cargo check. That's a maintainer's call. Without it, the list grows back.

This isn't a security problem. It's lint noise that each web PR has to work around.

Activity

  1. added
    needs-triage
    on Nov 5, 2026
  2. changed the title [-]Web app: clippy for wasm stops at a drop of a File in safe_write.rs, and 15 other warnings only that target shows[/-] [+]Web app: clippy for wasm stops at a drop of a File in safe_write.rs, and 12 other warnings only that target shows[/+] on Nov 5, 2026
  3. added
    in progress
    on Nov 5, 2026
  4. github-actions commented on Nov 5, 2026

    @github-actions
    Contributor

    Claimed by @thocsmith through #12251. The claim lapses after 14 days without pushes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in progressneeds-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions