Email or username:

Password:

Forgot your password?
Mara

🦀 I'm really excited about today's #rustlang release! 🥳

- offset_of!
- c"" string literals!
- stripping release binaries by default!
- IP/socket types available in no_std!
- File::create_new (won't overwrite existing files)!
- more array and slice methods (each_ref, chunk methods)!
- Mutex::clear_poison!

blog.rust-lang.org/2024/03/21/

15 comments
Daniel Collin 🦀

@Mara The C-string literals is a nice feature for someone (like me) that has to deal with C style interfaces quite a bit :)

Snowy :green_junimo:
@Mara I've been looking forward to most of them :neocat_aww:.
Rust is amazing
Mara

Really cool to see the c"" string literal feature stabilized. I wrote the RFC for c"" string literals [1], so I'm very excited to see it reach stable Rust today.

I had nothing to do with its implementation, however. The implementation was done by @beef [2] and quite a few others worked on it too [3]. Thanks all, for making this happen!

[1]: github.com/rust-lang/rfcs/pull
[2]: github.com/rust-lang/rust/pull
[3]: github.com/rust-lang/rust/issu

Really cool to see the c"" string literal feature stabilized. I wrote the RFC for c"" string literals [1], so I'm very excited to see it reach stable Rust today.

I had nothing to do with its implementation, however. The implementation was done by @beef [2] and quite a few others worked on it too [3]. Thanks all, for making this happen!

Mo :ferris: :tux:

@Mara Not directly, but I looked for something like this once to avoid a panic. In that case, I just wanted to "repair" the value inside by resetting it to some initial value.

chrysn

@Mara That poison clearing needed a lot of mental gymnastics to see why this is not unsafe.
I'd describe it as "Mutex users already have to make sure to always have their &mut T usable, or at least have to fix that during unwinding, and if the mutex is poisoned, that means that the thread that poisoned it unwound". Does that sound about right?

Mara

@chrysn Yes, poisoning isn't needed for soundness. No type should cause unsoundness because of unwinding. It's the same reason that AssertUnwindSafe is not unsafe. (The "safe" in "AssertUnwindSafe" is confusing, but it's unrelated to Rust's normal concept of memory (un)safety.)

[object Object]
@chrysn @Mara you could already retrieve the poisoned value previously, as part of the error returned when trying to acquire the lock of a poisoned Mutex. I don't think clearing the flag could possibly cause a new problem that didn't exist before
Corax

@Mara Awww, now I'm slightly disappointed it wasn't called cure_poison to stay in the metaphor ^^

kleines Filmröllchen

@Mara it's funny how they say "relatively minor release" and there's so much cool stuff in it regardless, especially the slicing and c string literals

Go Up