3 ms·
For one definition of "don't break". If you are UB, in my books (including the Rust book), you've broken. As per your comparison to C, you are mistaken, this w
by remram 3y ago
For one definition of "don't break". If you are UB, in my books (including the Rust book), you've broken.
As per your comparison to C, you are mistaken, this would do whatever C does when it has incorrect `restrict` qualifiers.
See how the book phrases it for yourself: https://doc.rust-lang.org/book/ch15-05-interior-mutability.html#enforcing-borrowing-rules-at-runtime-with-refcellt https://doc.rust-lang.org/book/ch15-05-interior-mutability.h... The way RefCell works is not described as a similar but different set of rules or invariants, but as enforcing the same rules.
Please do not ignore the compiler's assumptions in your own programs...
- wokwokwok 3y agoYou said, and I quote: > needs to be upheld both at compile time and run time for Rust code to function. That is not correct, in general, even if in some cases, it causes a crash via panic or segfault.
- remram 3y agoA program that fails under some circumstances is a buggy program. The fact that it doesn't crash under some circumstances is no redeeming quality at all. I don't know what you are trying to argue here. This thread is already too deep. Ownership rules are not optional. Sorry?
- wokwokwok 3y agoYou said, and I quote: > needs to be upheld both at compile time and run time for Rust code to function. That is not correct, in general, even if in some cases, it causes a crash via panic or segfault. /shrug If you want to argue a different point with someone, do it with someone else. I’m simply pointing out that you are categorically wrong in your statement.
- remram 3y agoI've explained and I've linked references, your last two comments say "not correct". If you don't want to argue don't, if you do please present arguments. You are not "pointing out" anything, you are stating against evidence.