Skip to content

Incorrect "operation requires unsafe block" #5996

Closed
@RalfJung

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.

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