about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/libcore/slice/mod.rs24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/libcore/slice/mod.rs b/src/libcore/slice/mod.rs
index aacbbd5058e..ac390313a67 100644
--- a/src/libcore/slice/mod.rs
+++ b/src/libcore/slice/mod.rs
@@ -1246,15 +1246,18 @@ macro_rules! iterator {
             {
                 // The addition might panic on overflow
                 // Use the len of the slice to hint optimizer to remove result index bounds check.
-                let n = make_slice!(self.ptr, self.end).len();
+                let _n = make_slice!(self.ptr, self.end).len();
                 self.try_fold(0, move |i, x| {
                     if predicate(x) { Err(i) }
                     else { Ok(i + 1) }
                 }).err()
-                    .map(|i| {
-                        unsafe { assume(i < n) };
-                        i
-                    })
+                    // // FIXME(#48116/#45964):
+                    // // This assume() causes misoptimization on LLVM 6.
+                    // // Commented out until it is fixed again.
+                    // .map(|i| {
+                    //     unsafe { assume(i < n) };
+                    //     i
+                    // })
             }
 
             #[inline]
@@ -1271,10 +1274,13 @@ macro_rules! iterator {
                     if predicate(x) { Err(i) }
                     else { Ok(i) }
                 }).err()
-                    .map(|i| {
-                        unsafe { assume(i < n) };
-                        i
-                    })
+                    // // FIXME(#48116/#45964):
+                    // // This assume() causes misoptimization on LLVM 6.
+                    // // Commented out until it is fixed again.
+                    // .map(|i| {
+                    //     unsafe { assume(i < n) };
+                    //     i
+                    // })
             }
         }