Skip to content

as_ref suggestions should warn about UB concerns #61786

Description

@RalfJung

With #61444 we are now suggesting people to use as_ref when they have a raw pointer and need a reference. With #61785 as_ref gets some expanded documentation on UB avoidance. It might be a good idea to mention that also in the actual suggestion, so people don't have to open the docs to be aware of this.

Cc @estebank

Activity

  1. added
    A-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`
    C-enhancementCategory: An issue proposing an enhancement or a PR with one.
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Jun 12, 2019
  2. added
    E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
    A-diagnosticsArea: Messages for errors, warnings, and lints
    on Jun 12, 2019
  3. imbrem commented on Jun 20, 2019

    @imbrem
    Contributor

    Can I take this on, since no one seems to have done it yet?

  4. RalfJung commented on Jun 20, 2019

    @RalfJung
    MemberAuthor

    Sure, it's yours!

  5. added a commit that references this issue on Jul 15, 2019
    40a7443
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

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`C-enhancementCategory: An issue proposing an enhancement or a PR with one.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.P-mediumMedium priorityT-compilerRelevant to the compiler 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