-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
2 changed files
with
21 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(()); | ||
} |