Closed
Description
When split_at_mut
is called with mid > len
, an internal assertion fails. However, it doesn't track its caller, so RUST_BACKTRACE=1
is required to determine the call site.
I tried this code:
fn main() {
let mut x = [1];
x.split_at_mut(2);
}
I expected to see this happen:
An error of the form thread 'main' panicked at 'split index (is 2) should be <= len (is 1)'
.
Instead, this happened:
thread 'main' panicked at 'assertion failed: mid <= self.len()', /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/core/src/slice/mod.rs:1279:9
Meta
This occurs on stable (1.50.0), beta (1.51.0-beta.8) and nightly (1.53.0-nightly 2021-03-21).
Tested on playground.