diff options
| author | Aaron Hill <aa1ronham@gmail.com> | 2020-01-01 20:10:55 -0500 |
|---|---|---|
| committer | Aaron Hill <aa1ronham@gmail.com> | 2020-01-01 20:10:55 -0500 |
| commit | e8e53b56dff3cd1f9e6d65ee30d5e0bfc55d9607 (patch) | |
| tree | 01164280b7eeceb1a28e10d42a7e371e5dc01010 /src/test/ui | |
| parent | 0ec370670220b712b042ee09aab067ec7e5878d5 (diff) | |
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.
Diffstat (limited to 'src/test/ui')
| -rw-r--r-- | src/test/ui/mir/issue-67710-inline-projection.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/ui/mir/issue-67710-inline-projection.rs b/src/test/ui/mir/issue-67710-inline-projection.rs new file mode 100644 index 00000000000..37d8f2eac9b --- /dev/null +++ b/src/test/ui/mir/issue-67710-inline-projection.rs @@ -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(()); +} |
