Skip to content

fix(desktop): compile rfd after nil-panel dialog_callback move (E0382) - #22

Merged
jmfcamp merged 2 commits into
mainfrom
cursor/fix-rfd-dialog-callback-move-81e6
Aug 20, 2026
Merged

fix(desktop): compile rfd after nil-panel dialog_callback move (E0382)#22
jmfcamp merged 2 commits into
mainfrom
cursor/fix-rfd-dialog-callback-move-81e6

Conversation

@jmfcamp

@jmfcamp jmfcamp commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Summary

Follow-up to #20 (vendor wry/rfd nil-NSOpenPanel guard) and #21 (bare return;return Self on the sync path). Apple Silicon just desktop-release-build still failed in vendored rfd:

error[E0382]: borrow of moved value: `dialog_callback`
  --> vendor/rfd/src/backend/macos/modal_future.rs:98:21

dialog_callback is a non-Copy Fn. Stock rfd 0.16.0 builds the panel, then moves that callback into the sheet RcBlock once. #20 made build_modal return Option<D> and added a nil-panel cancel after that move, so the later dialog_callback(state, NSModalResponseCancel) was a use-after-move.

The async sheet path now completes as NSModalResponseCancel before creating the RcBlock — same cancel / no-path behavior, no second use of the moved Fn. Sync path from #21 is unchanged (return Self { state }).

Hula branding is unchanged (productName Hula Buzz, bundle id com.huladesk.buzz, hulabuzz://). No extra crates vendored; no Tauri/wry bump.

Related issue

N/A. Follow-up to #20 and #21. None found for the E0382 compile break.

Testing

  • Source-string guards in macos_file_panel.rs now assert the async sheet path cancels the nil panel before RcBlock::new (catches a regression to use-after-move). Existing E0069 return Self { state } guard is unchanged. Those assertions pass.
  • Isolated rustc repro of the capturing-Fn / RcBlock move: the old order is E0382; the new order compiles.
  • This environment cannot run the Mac GUI or a full just desktop-tauri-test (no GTK). Do not treat CI as picker reproduction.

Verify on Apple Silicon / macOS 26:

  1. Merge this PR.
  2. Pull.
  3. just desktop-release-build
  4. Attach a file. rfd must compile (no E0382, no E0069). If the open/save panel is nil, the picker must cancel / produce no path instead of aborting.

Vite/chunk warnings and wry/rfd unused-unsafe warnings are not the failure.

Open in Web Open in Cursor 

cursoragent and others added 2 commits August 20, 2026 22:18
The async sheet path moved the non-Copy Fn into RcBlock, then called
it again when NSOpenPanel/NSSavePanel was nil (E0382). Complete as
cancel first, matching stock rfd's single post-move use.

Signed-off-by: Cursor Agent <cursoragent@cursor.com>

Co-authored-by: jmfcamp <jmfcamp@users.noreply.github.com>
Signed-off-by: Cursor Agent <cursoragent@cursor.com>

Co-authored-by: jmfcamp <jmfcamp@users.noreply.github.com>
@jmfcamp
jmfcamp marked this pull request as ready for review August 20, 2026 22:20
@jmfcamp
jmfcamp merged commit 7949c4b into main Aug 20, 2026
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