VOICEVOX / open_jtalk-rs

BSD 3-Clause "New" or "Revised" License
10 stars 12 forks source link

`clippy::cast_ref_to_mut`に準拠する #7

Closed qryxip closed 1 year ago

qryxip commented 1 year ago

clippy::cast_ref_to_mutに準拠するようにします。

Safe Rustの世界で&&mutに変換しようとする行為はまず禁忌であり、それゆえにこのlintはdenyになっているはずです。

  • Transmuting an & to &mut is Undefined Behavior. While certain usages may appear safe, note that the Rust optimizer is free to assume that a shared reference won't change through its lifetime and thus such transmutation will run afoul of those assumptions. So:
    • Transmuting an & to &mut is always Undefined Behavior.
    • No you can't do it.
    • No you're not special.

Transmutes - The Rustonomicon

PickledChair commented 1 year ago

マージしてしまいます!( @qwerty2501 共有です。コメントを聞けてなくてすみません……! もし問題がありそうでしたらコメントいただけると嬉しいです)