Skip to content

Incorrect "operation requires unsafe block" #5996

Description

@RalfJung

When using rust-analyzer with the standard library, it shows an error for this code in sore/src/ptr/const_ptr.rs:

    pub const fn guaranteed_eq(self, other: *const T) -> bool
    where
        T: Sized,
    {
        intrinsics::ptr_guaranteed_eq(self, other)
    }

It says this needs an unsafe block, but it evidently does not as the code compiles fine. Indeed, ptr_guaranteed_eq is a safe intrinsic.

Activity

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-easyE-has-instructionsIssue has some instructions and pointers to code to get startedS-actionableSomeone could pick this issue up and work on it right now

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions