Skip to content

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

Closed

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?

Activity

  1. added
    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.
    on Nov 12, 2018
  2. varkor commented on Nov 12, 2018

    @varkor
    Contributor

    This should be very straightforward to add by essentially copying what the current deprecated lint does, but limited to future deprecations.
    https://github.com/rust-lang/rust/blob/d6828cefd3787e8a732991d6273afc8793104cc3/src/librustc/lint/builtin.rs#L217-L222
    I can provide more detailed mentoring for those interested in tackling the issue, but I imagine one should be able to figure out the details without too much trouble.

  3. mominul commented on Nov 13, 2018

    @mominul
    Contributor

    I'd like to take this issue! If I get struck, I'll ask on the discord channel.

  4. RalfJung commented on Nov 14, 2018

    @RalfJung
    MemberAuthor

    Awesome, and please do :)

  5. mominul commented on Nov 19, 2018

    @mominul
    Contributor

    Sorry, I got quite busy in my studies. If anyone wants to take this issue in the meantime, please do!

  6. aheart commented on Nov 24, 2018

    @aheart
    Contributor

    I would like to give this a try.

  7. FrankSD commented on Dec 5, 2018

    @FrankSD

    Can i take this issue?

  8. RalfJung commented on Dec 5, 2018

    @RalfJung
    MemberAuthor

    I'm afraid it is already taken: #56203

  9. added a commit that references this issue on Dec 11, 2018
    86b786b
  10. added a commit that references this issue on Dec 12, 2018
    dadc916
  11. added 2 commits that reference this issue on Dec 12, 2018
    e983b55
    8bc8cdd
  12. added 3 commits that reference this issue on Dec 13, 2018
    94f5211
    634333a
    63e20b0
  13. added a commit that references this issue on Dec 14, 2018
    08a9cc3
  14. added a commit that references this issue on Dec 15, 2018
    93c2f05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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