[BUG] `llvm-cov` warning `mismatched data` when impl const fn
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
bug
llvm-cov warning mismatched data when impl const fn
reproduce
https://github.com/loynoir/reproduce-rust-130139
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)
}
pub const fn get(&self) -> i32 {
self.0
}
}
}
workaround
pub use bar::{Bar, bar_get_i32};
mod bar {
pub struct Bar<T>(T);
impl Bar<i32> {
pub const unsafe fn from_unchecked(value: i32) -> Self {
Bar(value)
}
pub fn get(&self) -> i32 {
self.0
}
}
pub fn bar_get_i32(bar: &Bar<i32>) -> i32 {
bar.0
}
}
related
llvm-cov warning mismatched data when double slash comment above use
https://github.com/rust-lang/rust/issues/130065
llvm-cov warning mismatched data when triple slash safety comment above unsafe fn
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 with the linked reproduction repository and run its llvm-cov example to confirm the mismatched data warning. Compare the const and non-const get cases, then read the related issues #130065 and #130097 for coverage of similar warnings. Done means the reported case no longer produces mismatched coverage data and has a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100