split_at_mut
should #[track_caller]
#83378
Labels
C-bug
Category: This is a bug.
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
When
split_at_mut
is called withmid > len
, an internal assertion fails. However, it doesn't track its caller, soRUST_BACKTRACE=1
is required to determine the call site.I tried this code:
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.
The text was updated successfully, but these errors were encountered: