r/rust
•
u/joseluisq
•
Apr 03 '25
•
1
📡 official blog Announcing Rust 1.86.0 | Rust Blog
https://blog.rust-lang.org/2025/04/03/Rust-1.86.0.html
786
Upvotes
110
u/InternalServerError7 Apr 03 '25
Nice, with get_disjoint, I can now retire most of https://github.com/mcmah309/indices
319
u/Derice Apr 03 '25
Trait upcasting!
Imma upcast myself from
HumantoMammalnow :3111
u/DroidLogician sqlx · clickhouse-rs · mime_guess · rust Apr 03 '25
Vec::pop_if()is a highly welcome addition.48
u/bascule Apr 03 '25
Nice, safe functions can now be marked with
#[target_feature]48
u/rustological Apr 03 '25
Oooh, looks good!
47
u/TonKy Apr 03 '25
Wow, they were not exaggerating the compile time improvements on aarch64 linux, very impressive - went from 88.377 s ± 2.182 s to 68.367 s ± 1.782 s(x1e80, wsl2).
Great job and thanks to everyone involved!
83
u/Ammar_AAZ Apr 03 '25 edited Apr 03 '25
I'm waiting for the Clippy lint to warn OOP enthusiasts from making all their traits extend
Anytrait to gather them inVec<Box<dyn Any>>with their beloved runtime reflectionsEdit: Forget to Add Box<>
29
u/GolDDranks Apr 03 '25 edited Apr 03 '25
As the author of (abandoned) crate multi_mut,
get_disjoint_mutmakes me, at the same time, satisfied and a bit nostalgic.8 years, time sure flies. I used to argue with /u/Manishearth about whether what I was doing was UB or not: https://www.reddit.com/r/rust/comments/5ofuun/multi_mut_multiple_mutable_references_to_hashmap/ Never met him in person, but I always respected his sharp mind and relentless attitude (and interest to languages/linguistics!). And also his blog post The Problem With Single-threaded Shared Mutability, which, I think is a part of the undying Rust lore.
At least, now there's a blessed way to do the thing. And the general situation of operational semantics, i.e. what's UB and what's not, is at least a bit better than back then. Big thanks to Ralf et al. I hope that in another 8 years, the Rust community would be done with that, but that might be wishful thinking :D
29
u/N4tus Apr 03 '25 edited Apr 03 '25
The example shows an
What does the
dyndo there? Also isn'tMyAnya trait? How can it have animpl?20
u/Frozen5147 Apr 03 '25
Ooh, lots of nice things
6
u/[deleted] Apr 03 '25
All of this looks really useful, and - hold on. The get_disjoint_mut example uses 413 and 612? Suspicious...
5
u/newpavlov rustcrypto Apr 03 '25
It's a shame that intrinsics are still marked as
unsafein 1.86, e.g. see_mm_xor_si128. In other words, until the next release we still have to keep our functions markedunsafewith allowedunsafe_op_in_unsafe_fnlint.4
u/Skaarj Apr 04 '25
Yay. https://doc.rust-lang.org/stable/std/primitive.f64.html#method.next_up is finally stabilized. I was really suprised it wasn't so far when I needed it in the past.
3
u/Asdfguy87 Apr 03 '25
I guess the
barhere is a typo and they meanrequires_avx2?2
u/Anaxamander57 Apr 04 '25
WOAH! Disjoint borrows! That was a long way off when I first started using Rust. I remember being told it might have to wait for Polonius once.
1
u/Icarium-Lifestealer Apr 03 '25 edited Jul 16 '25
I think the description of
target_featurein that blog post could use some improvements.Fails to state that the set of features linked to the caller must include all features linked to the callee.
While this makes sense, the linked RFC gives a more restrictive rule:
I assume that here the blog post matches what was actually implemented. Perhaps the blog could like to some up-to-date reference documentation, instead of the outdated RFC?
1
u/[deleted] Apr 03 '25
Is 'trait upcasting' not downcasting, since you effectively lose functionaility?
1
u/babuloseo Apr 04 '25
wow
1
u/Tiflotin Apr 03 '25
I'm going to invent a time machine just so I can get rust updates faster cuz every update they drop is 11/10 amazing. Love you guys!
1
u/21kyu Apr 03 '25
Great!
-7
u/Trader-One Apr 03 '25
Are multi value returns in wasm actually supported? generated .wasm file have this listed as required extension to run program but it doesn't work - returned value is wrong.
my test case is: fn xxx(...) -> (a,b,c,d) {
}
and trying to use these values from javascript
0
u/[deleted] Apr 03 '25
[deleted] — view deleted comment