madsmtm / objc2

Bindings to Apple's frameworks in Rust
https://docs.rs/objc2/
MIT License
280 stars 35 forks source link

Remove non-interior mutability in Foundation types #587

Open madsmtm opened 2 months ago

madsmtm commented 2 months ago

Part of https://github.com/madsmtm/objc2/issues/563.

I've run the new mut_while_iter fuzz target for using AFL++ ~8 hours with 8 parallell processes, and using libFuzzer for ~7 hours with 6 parallell processes, to test whether Foundation's mutation detection is precise enough to catch all errors, such that we can declare it sound.

A concrete place where this will be useful is Winit, which stores a RefCell<Id<NSMutableAttributedString>> inside of a subclass of NSView to track marked text, but the RefCell here should be completely unnecessary.