Open
Description
Code
// tests/ui/suggestions/issue-71394-no-from-impl.rs
Current output
error[E0277]: the trait bound `&[i8]: From<&[u8]>` is not satisfied
--> $DIR/issue-71394-no-from-impl.rs:8:25
|
LL | let _: &[i8] = data.into();
| ^^^^ the trait `From<&[u8]>` is not implemented for `&[i8]`
|
= help: the following other types implement trait `From<T>`:
`[T; 10]` implements `From<(T, T, T, T, T, T, T, T, T, T)>`
`[T; 11]` implements `From<(T, T, T, T, T, T, T, T, T, T, T)>`
`[T; 12]` implements `From<(T, T, T, T, T, T, T, T, T, T, T, T)>`
`[T; 1]` implements `From<(T,)>`
`[T; 2]` implements `From<(T, T)>`
`[T; 3]` implements `From<(T, T, T)>`
[...]
Desired output
error[E0277]: the trait bound `&[i8]: From<&[u8]>` is not satisfied
--> $DIR/issue-71394-no-from-impl.rs:8:25
|
LL | let _: &[i8] = data.into();
| ^^^^ the trait `From<&[u8]>` is not implemented for `&[i8]`
|
= help: the following other types implement trait `From<T>`:
`[T; 1]` implements `From<(T,)>`
`[T; 2]` implements `From<(T, T)>`
`[T; 3]` implements `From<(T, T, T)>`
[...]
`[T; 10]` implements `From<(T, T, T, T, T, T, T, T, T, T)>`
`[T; 11]` implements `From<(T, T, T, T, T, T, T, T, T, T, T)>`
`[T; 12]` implements `From<(T, T, T, T, T, T, T, T, T, T, T, T)>`
[...]
Rationale and extra context
The existing sorting displays 10, 11, 12, before it displays 1, 2, 3. Lower numbers should be sorted before higher numbers. In addition to sorting in a more semantically correct fashion, this would also present the user with less complex possibilities first.
Other cases
Rust Version
Git commit 7349f6b50359fd1f11738765b8deec5ee02d8710
Anything else?
No response