Announcing Rust 1.85.0 and Rust 2024 | Rust Blog (blog.rust-lang.org)
from thingsiplay@beehaw.org to programming@programming.dev on 20 Feb 17:14
https://beehaw.org/post/18560241

Finally the new Rust 1.85.0 update is here, with a new Rust Edition 2024.

#programming

threaded - newest

thingsiplay@beehaw.org on 20 Feb 20:07 next collapse

BTW no word about the Next Gen Trait solver: …rust-lang.org/…/trait-solving.html

Bogasse@lemmy.ml on 20 Feb 22:06 next collapse

Road to 2027 then?

TehPers@beehaw.org on 20 Feb 23:34 collapse

It was mentioned in the notes for 1.84.0 that they began migrating to it. They might be doing it without an edition change if it’s backwards compatible (or if the incompatibilities are considered bugs).

Ephera@lemmy.ml on 20 Feb 20:29 next collapse

Honestly, kind of most excited about std::env::home_dir() being fixed/undeprecated. That’s the kind of thing that some languages would leave unfixed for eternity, until half the community recommends not using the stdlib even for basic uses.

FizzyOrange@programming.dev on 20 Feb 21:21 next collapse

So glad they made the sane move and fixed std::env::home_dir(). The previous situation of having it deprecated due to fairly insignificant reasons, while recommending an abandoned crate instead was just silly.

Bogasse@lemmy.ml on 20 Feb 22:07 next collapse

The gen keyword is too much teasing, I know it’s not round the corner but I’m gonna explode 🥺

BB_C@programming.dev on 21 Feb 02:56 collapse

In case the wording tripped anyone, generators (blocks and functions) have been available for a while as an unstable feature.

This works (playground):

#![feature(gen_blocks)]

gen fn gfn() -> i32 {
    for i in 1..=10 {
        yield i;
    }
}

fn gblock() -> impl Iterator<Item = i32> {
    gen {
        for i in 1..=10 {
            yield i;
        }
    }
}

fn main() {
    for i in gfn() {
        println!("{i} from gfn()");
    }
    for i in gblock() {
        println!("{i} from gblock()");
    }
}

Note that the block-in-fn version works better at this moment (from a developer’s PoV) because rust-analyzer currently treats gfn() as an i32 value. But the block-in-fn pattern works perfectly already.

TheAgeOfSuperboredom@lemmy.ca on 21 Feb 16:17 collapse

Amazing! Thanks for that. I didn’t know this was actually available to play with.

livingcoder@programming.dev on 20 Feb 22:15 collapse

I love the async closure update and the if-let scoping fix.