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

Currently when you have crate A with a deprecated function there is no warning until crate B tries to actually use that deprecated function, so clearly there is some place that crate B can look at to see whether a particular method is deprecated, there is even place for a note field that will get printed when crate B tries to access it.

Why would it not be possible to have some additional information that says "from rust edition 2021 onwards this is actually obsolete". Whether crate B merely gives a warning on compilation or an error then depends on crate B's edition.

Sure that means you can still use the method if you really want to (by using older editions), and it also means that if some of your dependencies are still on an older edition you can't prevent it from being used by them, but it would be a higher hurdle to accidental usage.



> Why would it not be possible

There may be a way in which it is possible, but it is not currently possible. We’d have to have a different design.




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

Search: