bevy icon indicating copy to clipboard operation
bevy copied to clipboard

bevy_dynamic_plugin: fix `unsafe_op_in_unsafe_fn` lint

Open BD103 opened this issue 1 year ago • 2 comments

Objective

  • Part of #11590.

Solution

  • Fix unsafe_op_in_unsafe_fn for bevy_dynamic_plugin.

Changelog

  • Added further restrictions to the safety requirements of bevy_dynamic_plugin::dynamically_load_plugin.

I had a few issues, specifically with the safety comment on dynamically_load_plugin. There are three different unsafe functions called within the function body, and they all need their own justification / message.

Also, would it be unsound to call dynamically_load_plugin multiple times on the same file? I feel the documentation needs to be more clear.

BD103 avatar Jan 30 '24 18:01 BD103

It seems there is a deeper issue with bevy_dynamic_plugin after asking on Discord. While a more permanent fix should eventually be developed, I think this PR is trivial enough that it should still be merged.

I do honestly need help writing the text for that one unsafe block though. :)

BD103 avatar Jan 30 '24 21:01 BD103

I just rebased this branch and resolved the conflicts. :)

BD103 avatar Feb 09 '24 22:02 BD103