News for hackers. Stuff that matters.
Re:Changing the Rules of Rust by thayne on Sunday September 17, 2023 @03:53PM (#37548718)
Besides the Move and Leak traits mentioned in this article, there are several changes I would make to the standard library if backwards compatibility wasn't a concern, including:

Changing Iterator to make use of Generic Associated Types.

Change std::env::set_var to be unsafe. Because using it in multithreaded program causes undefined behavior for any c code that reads the environment (which includes quite a few libc and posix functions).

Change channels to have a better API that is mpmc and closer to crossbeam.

And probably others I can't think of at the moment.

Re:Changing the Rules of Rust by afdbcreid on Monday September 18, 2023 @11:14AM (#37557295)
I'm curious about the "change channels to be mpmc" one. Why isn't it backwards-compatible?

About `std::env::set_var()`, there was a proposal for a `#[deprecated_safe]` attribute that triggers a warning if the function is used without an unsafe block, and eventually make that a hard error in future edition.