Skip to content

Add allow-by-default lint when using item deprecated in the future #55892

Closed
@RalfJung

Description

@RalfJung

With #30785 resolved, there now is a way to deprecate an item "for the future". It would be nice to be able to e.g. clean libstd from using such future-deprecated items and then to make sure that future PRs will not re-introduce new uses of that item again. I am thinking, for example, of when we will deprecate mem::uninitialized in favor of MaybeUninit: Once we got rid of all its uses in some crate here, we'll want to make sure people not aware of this deprecation do not accidentally reintroduce new uses of mem::uninitialized in libstd.

So maybe we could have an allow-by-default lint that libstd (and its dependencies) opt in to that complains about using items that are marked for future deprecation?

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions