Ensure that we process projections during MIR inlining
Fixes #67710 Previously, we were not calling `super_place`, which resulted in us failing to update any local references that occur in ProjectionElem::Index. This caused the post-inlining MIR to contain a reference to a local ID from the inlined callee, leading to an ICE due to a type mismatch.
This commit is contained in:
parent
0ec3706702
commit
e8e53b56df
2 changed files with 21 additions and 8 deletions
17
src/test/ui/mir/issue-67710-inline-projection.rs
Normal file
17
src/test/ui/mir/issue-67710-inline-projection.rs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
// compile-flags: -Z mir-opt-level=2
|
||||
// build-pass
|
||||
|
||||
// This used to ICE due to the inling pass not examining projections
|
||||
// for references to locals
|
||||
|
||||
pub fn parse(version: ()) {
|
||||
p(&b'.', b"0");
|
||||
}
|
||||
#[inline(always)]
|
||||
fn p(byte: &u8, s: &[u8]) {
|
||||
!(s[0] == *byte);
|
||||
}
|
||||
|
||||
fn main() {
|
||||
parse(());
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue