3 ms·
There was also a bug in the Linux kernel, or did I miss something?
by senfiaj 3mo ago
There was also a bug in the Linux kernel, or did I miss something?
- IshKebab 3mo agoYes there was. It's detailed in the article.
- senfiaj 3mo agoBut why wouldn't have happened with Rust? Sorry I can't find anything about Rust in the article. Or you mean if the Linux kernel was written in Rust and that stupid bool coercion was not possible?
- grg0 3mo agoIt's the latter; Rust won't allow the int->bool coercion. Though to be absolutely pedantic, !x is an int for x:int in C, there is no bool coercion involved; an if-statement takes an expression of any scalar value and evals to true on non-zero. Not that that helps to avoid introducing bugs anyway.
- IshKebab 3mo agoBecause Rust programmers would have used an enum or Result.