ekuber,
@ekuber@hachyderm.io avatar

Sometimes I wish that rustc had a database of small breaking changes that affect only a handful of crates, so that we could on the fly patch them going forward. Things like "we now correctly check for lifetimes in assoc types" can technically be a breaking change that affects a handful of crates, but I want to ensure that building a project from today in 15 years doesn't require a compiler tool chain from today.

I guess this is the windows backwards compatibility approach.

kornel,
@kornel@mastodon.social avatar

@ekuber Can this be in Cargo instead, and force-upgrade known-broken crates?
And yeah, that requires releasing fixed versions of the broken crates.

ekuber,
@ekuber@hachyderm.io avatar

@kornel you would want to make patch releases for pretty much every affected dot release, but that would likely be the best option.

chrisg,
@chrisg@fosstodon.org avatar

@ekuber At neo4j I called this the "we got addition wrong" problem.

What if Cypher had a bug that added 1 to every addition? Then users would need to -1 every result. Once we discovered it, it would mean that every codebase that had patched the issue would now be broken even though we fixed the issue.

I would argue that what you describe would be a compiler config, because from the user's perspective it's like a reverse experimental feature.

chrisg,
@chrisg@fosstodon.org avatar

@ekuber That means you put the burden on the user to flag which (now corrected) behaviors they depend on and, as long as they are present in the compiler, the project will keep compiling.

I'm not sure the compiler should know which crates depend on certain behaviors. That feels wrong.

ekuber,
@ekuber@hachyderm.io avatar

@chrisg we already do for a handful of things. Macro handling comes to mind. The principled answer is "editions", of course.

chrisg,
@chrisg@fosstodon.org avatar

@ekuber Editions, in this context, would be collections of "feature flags", right? If so, that would require discipline on both sides. Not a deal breaker, of course, but perhaps a different approach.

ekuber,
@ekuber@hachyderm.io avatar

@chrisg I guess so. The problem is the maintenance burden of alternative behavior for fundamental checks, but that's kind of what we signed up for with editions.

ekuber,
@ekuber@hachyderm.io avatar

It could even be for providing specific errors instead of "just make it work", telling people what magic changes might be needed to patch the outdated library.

matthiaskrgr,

@ekuber can we isolate the breaking change from other compiler errors inside rustc and provide a MachineApplicable suggestion for that specific case?

ekuber,
@ekuber@hachyderm.io avatar

@matthiaskrgr we could be able to. We could downgrade the error to a warning then 🤔

  • All
  • Subscribed
  • Moderated
  • Favorites
  • rust
  • ngwrru68w68
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • megavids
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • provamag3
  • JUstTest
  • All magazines