Name similarity metric should consider ordering of name parts being swapped
Open
@jhpratt is already working on this.
Since Aug 7, 2025.
A-diagnostics
T-compiler
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
Code
fn main() {
dbg!(u16::from_bytes_le([21, 37]));
}
Current output
error[E0599]: no function or associated item named `from_bytes_le` found for type `u16` in the current scope
--> src/main.rs:2:15
|
2 | dbg!(u16::from_bytes_le([21, 37]));
| ^^^^^^^^^^^^^ function or associated item not found in `u16`
|
help: there is an associated function `from_be` with a similar name
|
2 - dbg!(u16::from_bytes_le([21, 37]));
2 + dbg!(u16::from_be([21, 37]));
|
Desired output
error[E0599]: no function or associated item named `from_bytes_le` found for type `u16` in the current scope
--> src/main.rs:2:15
|
2 | dbg!(u16::from_bytes_le([21, 37]));
| ^^^^^^^^^^^^^ function or associated item not found in `u16`
|
help: there is an associated function `from_le_bytes` with a similar name
|
2 - dbg!(u16::from_bytes_le([21, 37]));
2 + dbg!(u16::from_le_bytes([21, 37]));
|
Rationale and extra context
No response
Other cases
Rust Version
current nightly on play.rust-lang.org
Anything else?
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.