]> git.lizzy.rs Git - rust.git/commit - src/tools/clippy
Rollup merge of #67546 - oli-obk:slice_pattern_ice, r=varkor
authorMazdak Farrokhzad <twingoow@gmail.com>
Mon, 23 Dec 2019 14:16:31 +0000 (15:16 +0100)
committerGitHub <noreply@github.com>
Mon, 23 Dec 2019 14:16:31 +0000 (15:16 +0100)
commit7eb025febf48c294e376cedd4b57865792cefa99
tree9058e0c0c1ce9c467c01ede02c55a7362f5ef145
parent41647613b1a69e7df7490d23fee2823da249cda4
parent5b8df34203d1d6f308da7413c9f27b0b0887b438
Rollup merge of #67546 - oli-obk:slice_pattern_ice, r=varkor

Fix ICE in mir interpretation

Indices from the end start at 1 so you can immediately subtract them from the length to get the index instead of having to do an additional `-1`. Kinda documented in https://doc.rust-lang.org/nightly/nightly-rustc/rustc/mir/enum.ProjectionElem.html#variant.ConstantIndex
src/librustc_mir/interpret/place.rs