Hacker News new | ask | show | jobs
by markwisde 1867 days ago
“We can’t add tryinto to the prelude, as a solution we’re adding tryinto”

What?

1 comments

You cropped out the relevant part:

> As a solution, Rust 2021 will use a new prelude.

That is, we cannot add it into the existing prelude. But we could have a new prelude, tied to the new edition.

Shouldn't more of those prelude items be in "core", rather than "std"? Many involve neither I/O nor allocation.
All of the new items are in "core", e.g. https://doc.rust-lang.org/core/convert/trait.TryInto.html
Everything in core is also in std. You only link to anything in core in a no_std context (or if you do it explicitly for some reason)
I don’t see how this solves the issue of colliding with a user-provided tryinto
It solves the issue by not breaking any existing code that doesn't explicitly opt in to the new edition.