rust-lang / rust-lang/rust

Name similarity metric should consider ordering of name parts being swapped

Open
#145,015 4 comments 0 reactions 1 assignee View on GitHub

@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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.