Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Here's an idea, for a kind of soft rollout. Implement a optional feature for 2021-edition crates that allow specifying Leak. The trait has no effect in 2021.

In next-edition:

- 2021 crates that turned Leak feature uses it just as a next-edition crate would. Only things explicitly marked with Leak in the crate can leak.

- 2021 crate that didn't opt-in to Leak feature, automatically marks everything in the crate with Leak.



I think the big caveat mentioned in the editions section (https://without.boats/blog/changing-the-rules-of-rust/#editi...) still applies to your suggestion. The author concludes in that section "I don’t know if this is even possible to implement, probably it would have pretty bad effect on compile times at".

Your refinement seems like a nice addition to the author's suggestion, if it is possible and doesn't effect compile times too much. Hopefully somebody smarter than me takes a run at the problem.


from __future__ import Leak




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: