News for hackers. Stuff that matters.
Re:A Grand Vision for Rust by pjmlp on Sunday March 08, 2026 @03:41AM (#47295403)
It has clang tidy, -std=lang-version, and preprocessor that is version aware.

Rust editions don't cover all use cases that one can think of regarding language evolution, and requires full access to source code.

Re:A Grand Vision for Rust by SkiFire13 on Sunday March 08, 2026 @07:08AM (#47296376)
> requires full access to source code

What do you mean? Editions don't require full access to source code. Rust in general relies heavily on having access to source code, but that has nothing to do with how editions work

Re:A Grand Vision for Rust by zozbot234 on Sunday March 08, 2026 @08:18AM (#47296729)
You can write a binary library that exposes a C ABI using Rust (which is indistinguishable from an ordinary C/C++ library) and then provide source for a Rust wrapper crate that provides a "safe" interface to it, much like a C header file.
Re:A Grand Vision for Rust by pjmlp on Sunday March 08, 2026 @08:49AM (#47296905)
Yes they do, when mixing crates from various editions and how changes interact together.
Re:A Grand Vision for Rust by aw1621107 on Sunday March 08, 2026 @11:43AM (#47298240)
> when mixing crates from various editions and how changes interact together.

Could you elaborate more on this? It's not obvious to me right now why (for example) Crate A using the 2024 edition and Crate B using the 2015 edition would require both full access to both crates' source beyond the standard lack of a stable ABI.

Re:A Grand Vision for Rust by pjmlp on Sunday March 08, 2026 @02:08PM (#47299500)
Because in order to have standard library breaking changes across editions, if those types are exposed in the crate public types, or change their semantics across editions, the compiler has to be able to translate between them when generating code.

See the Rust documentation on what editions are allowed to change, and the advanced migration guide on examples regarding manual code migration.

Not so much what has happened thus far, rather the limitations imposed in what is possible to actually break across editions.

Re:A Grand Vision for Rust by Rusky on Sunday March 08, 2026 @03:56PM (#47300729)
Or put another way, a hypothetical feature that you made up in your head is the thing that requires source access. Editions do not let you change the semantics of types.

To be fair, Rust tooling does tend toward build-from-source. But this is for completely different reasons than the edition system: if you had a way to build a crate and then feed the binary into builds by future compilers, it would require zero additional work to link it into a crate using a different edition.

Re:A Grand Vision for Rust by pjmlp on Sunday March 08, 2026 @06:22PM (#47302242)
Exactly, hence why people should stop talking about editions as if they sort out all Rust evolution problems, in your own words it doesn't allow changing type semantics
Re:A Grand Vision for Rust by ChrisSD on Sunday March 08, 2026 @07:44PM (#47302910)
I think you're too stuck on the current implementation. Work is going into investigating how to evolve the standard library over editions. The "easiest" win would be to have a way to do edition-dependent re-exports of types.
Re:A Grand Vision for Rust by pjmlp on Monday March 09, 2026 @06:00AM (#47306940)
What I am stuck is Rust folks advocating editions as the solution for everything in language evolution, when it clearly isn't.
Re:A Grand Vision for Rust by aw1621107 on Sunday March 08, 2026 @04:28PM (#47301069)
What you're describing sounds more like a potential issue with editions if/when they allow breaking stdlib changes more than a problem with editions as they exist today, which is more what I took the original comment to be talking about.
Re:A Grand Vision for Rust by pjmlp on Sunday March 08, 2026 @06:23PM (#47302245)
Exactly because they don't allow it, they don't cover all scenarios regarding language evolution
Re:A Grand Vision for Rust by aw1621107 on Sunday March 08, 2026 @07:51PM (#47302972)
OK, sure, but again what breaking changes editions do/don't currently allow is independent from what SkiFire13/I was responding to, which was the "requires full access to source code" bit.
Re:A Grand Vision for Rust by pjmlp on Monday March 09, 2026 @06:02AM (#47306950)
How do you expect a compiler to be able to mix and match changes across editions between crates, if those happen to be changes in semantic behaviour?
Re:A Grand Vision for Rust by aw1621107 on Monday March 09, 2026 @10:01AM (#47309193)
Depends on the change. Obviously the compiler doesn't need to care about cross-edition compatibility between crates if the changes in question don't impact the public API. Otherwise, I'd expect the compiler to canonicalize the changes, and from what I understand that is precisely how edition changes are chosen/designed/implemented.