Deprecate static mut (in the next edition?)

I'm generally opposed to any sort of "whenever you use this language feature at all you get a warning" plan.

This regularly comes up related to floats, for example, around things like warning about x == 0.0. And yes, there's gotchas about that, but it's also possibly the right thing. So I really don't want a lint that basically becomes #![allow(yes_i_know_that_i_am_using_floats)].

I think "there's a better way that you should write this instead" warnings are usually a better fit for more opinionated tools -- rustc usually oughtn't bother you if you're doing something fine, even if it's something not great, at least for things that are internal to your crate. That helps encourage people to take seriously the warnings they do get.

Though certainly the line between "not great" and "error-prone" is often fuzzy.

Jumping to deny inside an edition is allowed, just not to error. Though it's certainly rare, because things we feel strongly enough to deny in rustc are uncommon.

2 Likes