You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In pattern_matching/myers/simple.rs, the implementation of the StatesHandler trait for ShortStatesHandler uses unsafe in the methods set_max_state and add_state. Current code:
These uses of unsafe are both unnecessary and allow the caller to cause UB from safe Rust.
They are unnecessary since they can trivially be implemented in safe rust (as demonstrated by the commented code just above), and the performance benefits are almost certainly negligible (according to much discussion I've read which I unfortunately can't find atm).
Regardless of possible performance benefits, allowing UB from safe Rust should never be allowed and so they should be removed.
The text was updated successfully, but these errors were encountered:
In
pattern_matching/myers/simple.rs
, the implementation of theStatesHandler
trait forShortStatesHandler
uses unsafe in the methodsset_max_state
andadd_state
. Current code:These uses of unsafe are both unnecessary and allow the caller to cause UB from safe Rust.
They are unnecessary since they can trivially be implemented in safe rust (as demonstrated by the commented code just above), and the performance benefits are almost certainly negligible (according to much discussion I've read which I unfortunately can't find atm).
Regardless of possible performance benefits, allowing UB from safe Rust should never be allowed and so they should be removed.
The text was updated successfully, but these errors were encountered: