Skip to content

[BUG] llvm-cov warning mismatched data when triple slash safety comment above unsafe fn #130097

Open
@loynoir

Description

@loynoir

bug

llvm-cov warning mismatched data when triple slash safety comment above unsafe fn

reproduce

https://github.com/loynoir/reproduce-rust-130097

pub use bar::Bar;

mod bar {
    pub struct Bar<T>(T);

    impl Bar<i32> {
        /// # Safety
        ///
        /// be careful
        pub const unsafe fn from_unchecked(value: i32) -> Self {
            Bar(value)
        }
    }
}

workaround

pub use bar::Bar;

mod bar {
    pub struct Bar<T>(T);

    impl Bar<i32> {
        pub const unsafe fn from_unchecked(value: i32) -> Self {
            Bar(value)
        }
    }
}

related

llvm-cov warning mismatched data when double slash comment above use

#130065

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-code-coverageArea: Source-based code coverage (-Cinstrument-coverage)C-bugCategory: This is a bug.S-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueT-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