4 ms·
> Rust does not encode the difference between "is true" and "was, at least briefly, true" in the type system. Couldn't it encode that by taking advantage of th
by josephcsible 4y ago
> Rust does not encode the difference between "is true" and "was, at least briefly, true" in the type system.
Couldn't it encode that by taking advantage of the fact that nobody else can change a variable while you have it mutably borrowed?
- marcosdumay 4y agoIsn't that exactly what people do. This thread seems surreal to me. Rust type system does encode exactly what the later comments are complaining that isn't encoded. And you sate what code cares about the variable keeping its value through a code block, between a pair of braces.
- MauranKilom 4y agoWhat I meant was *For atomics*, rust does not encode the difference between "is true" and "was, at least briefly, true" in the type system. Obviously, rust has many ways to track this kind of distinction in a compile-time manner (and yes, the borrow checker is one of them). That was not in question.
- marcosdumay 4y agoHum, ok. You don't consider the borrow checker to be part of the type system. Well, it's perfectly fine to disagree on name definitions, but that is some fuzzy and dizzy line. Lifetimes impose themselves together with the static types features all the time.
- MauranKilom 4y agoThe quoted sentence is talking specifically about atomic variables. I would edit it if I still could.