MIR InstCombine introduces copies of mutable borrows #46420
Labels
A-borrow-checker
Area: The borrow checker
A-mir
Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
https://play.rust-lang.org/?gist=9f782298cc5b0f6cd557baef9e443096&version=nightly
generates the following MIR:
Which -- though we don't run it again after optimizations -- wouldn't pass
TypeckMir
since it's a copy of a&mut String
.That came from InstCombine on the following
This may or may not be a problem, but I wanted to file it in case it impacts any of the assumptions desired from the Copy/Move split on Operand.
Edit: I suppose this instcombine has long potentially changed the type of the operand, since it doesn't check mutability of the outer
&
or the borrow being*
d.cc @eddyb
The text was updated successfully, but these errors were encountered: