Skip to content

Document all unsafety used in libcore and libstd #66219

Description

@oli-obk

The repository still contains many instances of

// ignore-tidy-undocumented-unsafe

We should eliminate all of them by documenting the unsafe used in those files.

Documenting unsafe blocks works by adding a // SAFETY: comment infront of them explaining why the unsafe block is ok. If there is an explanation about the unsafety elsewhere in the file, you can also leave a // SAFETY: comment explaining that the overarching logic is explained elsewhere (and mention where, too!)

cc @Centril

not sure what labels to add to this issue.

See https://github.com/rust-lang/rust/pull/63793/files for examples and the introduction of the unsafety tidy check

Activity

  1. added
    C-cleanupCategory: PRs that clean code up or issues documenting cleanup.
    on Nov 8, 2019
  2. added
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    T-libs-api[DEPRECATED; DO NOT USE]
    E-help-wantedCall for participation: Help is requested to fix this issue.
    E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
    E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.
    E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
    on Nov 8, 2019
  3. foeb commented on Nov 9, 2019

    @foeb
    Contributor

    Hi! I'm interested in working on this.

  4. foeb commented on Nov 9, 2019

    @foeb
    Contributor

    @rustbot claim

  5. self-assigned this
    on Nov 9, 2019
  6. added 5 commits that reference this issue on Nov 9, 2019
  7. 35 remaining items

  8. added a commit that references this issue on Nov 25, 2020
  9. removed their assignment
    on Jun 2, 2021
  10. poliorcetics commented on Jul 14, 2021

    @poliorcetics
    Contributor

    With #87127, only some unsafe blocks in src/libcore/slice/sort.rs are left. I looked them over and I don't think I understand the algorithm well enough to make a SAFETY comment for them though

  11. added 3 commits that reference this issue on Jul 15, 2021
  12. added a commit that references this issue on Aug 25, 2021
  13. added a commit that references this issue on Sep 29, 2021
  14. added a commit that references this issue on Sep 30, 2021
  15. mdsn commented on Sep 30, 2021

    @mdsn
    Contributor

    With #88412 merged I believe libstd is now free of // ignore-tidy-undocumented-unsafe which means this issue might be done.

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

    C-cleanupCategory: PRs that clean code up or issues documenting cleanup.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-help-wantedCall for participation: Help is requested to fix this issue.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-libsRelevant to the library team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions