about summary refs log tree commit diff
path: root/tests/ui/consts/const-eval/ub-slice-get-unchecked.stderr
blob: 88ea310f19c686319c8e97ec43dc896c5d8e443e (plain)
1
2
3
4
5
6
7
8
9
10
11
error[E0080]: evaluation panicked: unsafe precondition(s) violated: slice::get_unchecked requires that the range is within the slice
              
              This indicates a bug in the program. This Undefined Behavior check is optional, and cannot be relied on for safety.
  --> $DIR/ub-slice-get-unchecked.rs:7:27
   |
LL | const B: &[()] = unsafe { A.get_unchecked(3..1) };
   |                           ^^^^^^^^^^^^^^^^^^^^^ evaluation of `B` failed here

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0080`.