Closed
Description
Most of the time it happens automatically due to DST coercions &[T; N] => &[T]
, but sometimes additional care is required.
One example, where it currently doesn't work, is comparison operators between slices/arrays/vectors:
fn main() {
let a: &[u8; 3] = &[1, 2, 3];
let b: &[u8] = &[1, 2, 3];
// Both comparisons doesn't compile
a == b;
b == a;
}
When #18465 is implemented, the code comparing byte string literals with slices will break. A lot of such code can be found, for example, in libstd/path.