[BUG] `llvm-cov` warning `mismatched data` when triple slash safety comment above `unsafe fn`
Open
Nobody has claimed this yet.
A-code-coverage
A-LLVM
C-bug
S-has-mcve
T-compiler
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the linked reproduction and compare llvm-cov output for the code with and without the triple-slash safety comment; no source file or test is named in the issue. Review the related issue about a double-slash comment above use, then confirm the original example no longer produces a mismatched-data warning while retaining the safety comment.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100