Add #[track_caller] to slice::copy_from_slice #78900
Labels
A-slice
Area: `[T]`
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
F-track_caller
`#![feature(track_caller)]`
Uh oh!
There was an error while loading. Please reload this page.
In this trivial case:
The current panic message is:
thread 'main' panicked at 'source slice length (3) does not match destination slice length (16)', /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/core/src/slice/mod.rs:2517:13
If
#[track_caller]
is added toslice::copy_from_slice
, the panic message could instead be:thread 'main' panicked at 'source slice length (3) does not match destination slice length (16)', example/src/main.rs:3:9
On a related note,
slice::clone_from_slice
would also benefit from a#[track_caller]
annotation as well.Meta
rustc --version --verbose
:Backtrace
The text was updated successfully, but these errors were encountered: