josh
December 23, 2021, 8:41pm
1153
Self-nomination:
One reason we keep certain things as hard errors rather than lints: it establishes a baseline that you can safely assume about other people's code, since it can't be turned off. And as a result, that baseline can become part of people's mental model of Rust itself, rather than something that might or might not be true in any given codebase.
We have to take care to not use that lightly, because that places work on all users of Rust to maintain code to that baseline. But there are cases where we do. We don't allow using one integer type where another was expected. We don't allow certain operations outside an unsafe block. ...
I think the standard we should apply is asking whether something is part of the baseline that people should be able to assume about all Rust code, and if that's worth the tradeoff of requiring that baseline of all Rust users.
Rust requires declaring bindings with a mut keyword if they're reassigned or mutably borrowed. Otherwise it's an error E0596. The problem is, lack of mut in let mut is not really a fatal error. It's hardly an error at all. Unlike &mut, this...
Reading time: 41 mins 🕑
Likes: 476 ❤
(The elision there is to avoid making any commentary on the actual issue in that topic part of the quote; in general, I think we should avoid highlighting quotes that directly comment on one side of an active topic, so I left that part out.)
9 Likes