this post was submitted on 20 Feb 2025
46 points (100.0% liked)

Rust Programming

8386 readers
7 users here now

founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 11 points 1 day ago (2 children)

Just upgraded ten or so smaller projects with no compile errors whatsoever. And then one larger project (probably 20k lines of code or so), which just had a few calls to env::set_var() that needed to be wrapped in unsafe, as well as some uses of ref in pattern-matching, which were apparently not needed, so I'm actually glad to be rid of those.

Very happy with that overall. I was already worried, they might introduce too many breaking changes with how long they were working on this edition, but those worries just evaporated.

[–] [email protected] 3 points 1 day ago (1 children)

Be careful to not upgrade Libraries, as it implicitly bump the msrv ;)

[–] [email protected] 3 points 1 day ago (1 children)

Ah, I was just wondering, if I should be upgrading all my libraries. It's not like many users would be impacted, but still good to be aware of.

[–] [email protected] 2 points 1 day ago

In general, apps/bins should strive for the latest msrv and lastest dependencies

Libraries should do the reverse and try for the lowest msrv and dependencies version (That actually work! Don't put version = "1" when you need 1.4.2!)

[–] BB_C 3 points 1 day ago (2 children)

Just upgraded

Weird wording!
Maybe it's just me, but this may give the impression that it's something that is strictly needed, or will provide any immediate improvement, which is not the case, unless you're still actively working on these projects and plan to use/depend on features/behaviors required by the new edition.

[–] [email protected] 2 points 1 day ago (1 children)

That's the case with every software updates. Upgrading just means that you jumped to the newer version. Like upgrading to the newest Firefox won't give everyone the same benefit instantly, but its an upgrade in version nonetheless (as an analogy to Rust version).

[–] BB_C 1 points 17 hours ago (1 children)

That's exactly the communicated meaning I was concerned an oblivious reader might get. You can use an updated Rust compiler 10 years in the future while your crate is still on 2015/2018/2021 edition. Editions are NOT software versions.

[–] [email protected] 2 points 10 hours ago

I think you misunderstand the point here. The upgrade in this case means a plus in version number, that's what is said here. I was not implying that older versions of Rust Editions get obsolete.

[–] [email protected] 3 points 1 day ago (1 children)

Yeah, fair enough. I was mainly curious, how much would break, as in how quickly I might expect the Rust ecosystem to adopt these new features. Well, and unless there's a reason against it, I'd prefer having everything on the same edition, i.e. the newest edition.

[–] BB_C 1 points 1 day ago (1 children)

I might expect the Rust ecosystem to adopt these new features.

This again points to you maybe not understanding how editions work, or maybe I'm just reading it wrong again. But you "upgrading" has no effect on your dependencies, and vise versa (except indirectly if MSRV is a factor as another user mentioned).

[–] [email protected] 2 points 1 day ago

I'm just talking about things like async closures looking like they might be really useful in a frontend framework we use. And I'm wondering when that framework's documentation will recommend their usage. Or if there's fancy things they can do with the AsyncFn traits.

I will have to try out, if I can just pass an async closure without that framework changing anything. That's the kind of thing where I am still unclear, how it will affect things. But the basic premise of editions isn't lost on me, and this isn't my first edition switchover either.