about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDylan MacKenzie <ecstaticmorse@gmail.com>2019-11-02 11:23:16 -0700
committerDylan MacKenzie <ecstaticmorse@gmail.com>2019-11-02 11:26:08 -0700
commit981e11e8ce17834713d354cc95755ea8a7905c6a (patch)
tree6168e17ae7128f27634f79a4fe94cac7963e7888
parentf39205b5d9825fcf35989b5a04d115d411175d18 (diff)
downloadrust-981e11e8ce17834713d354cc95755ea8a7905c6a.tar.gz
rust-981e11e8ce17834713d354cc95755ea8a7905c6a.zip
Don't double-count `simd_shuffle` promotion candidates
The proper attribute was added to `simd_shuffle*` in
rust-lang/stdarch#825. This caused `promote_consts` to double-count its
second argument when recording promotion candidates, which caused
the promotion candidate compatibility check to fail.
-rw-r--r--src/librustc_mir/transform/promote_consts.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/librustc_mir/transform/promote_consts.rs b/src/librustc_mir/transform/promote_consts.rs
index 83f3aafc55c..f5e49e32834 100644
--- a/src/librustc_mir/transform/promote_consts.rs
+++ b/src/librustc_mir/transform/promote_consts.rs
@@ -199,6 +199,8 @@ impl<'tcx> Visitor<'tcx> for Collector<'_, 'tcx> {
                             bb: location.block,
                             index: 2,
                         });
+
+                        return; // Don't double count `simd_shuffle` candidates
                     }
                 }