rust-lang / rust-lang/rust-analyzer
MIR eval loses block local trait implementations when evaluating
Open
Nobody has claimed this yet.
A-mir
C-bug
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
#[test]
fn regression_block_def_map() {
check_pass(
r#"
//- minicore: sized
trait Write {
fn write(&mut self) {
trait SpecWriteFmt {
fn spec_write_fmt(self);
}
impl<W: Write + ?Sized> SpecWriteFmt for &mut W {
#[inline]
default fn spec_write_fmt(self) {}
}
impl<W: Write> SpecWriteFmt for &mut W {
#[inline]
fn spec_write_fmt(self) {}
}
self.spec_write_fmt()
}
}
struct C;
impl Write for C {}
fn main() {
C.write();
}
"#,
);
}
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 regression_block_def_map test in the issue and run it in rust-analyzer. Trace MIR evaluation for the block-local trait implementations in the reproducer; done when check_pass succeeds without losing those implementations. The issue also points to pull request 16299 for related context.
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
- Mostly clear
- Newbie friendliness
- 45/100