TGViewer
Блог* Блог* @dereference_pointer_there · 1.97K subscribers
Post #11596 358
#prog #rust #suckassstory

rustc uses the Path hash code to identify files, and the Path hash implementation is particularly weak because it ignores separators. As of PR #127297, it tries to compensate by mixing the component lengths into the hash, but it's still easy to manufacture collisions. That includes collisions where both sides look like plausible source paths, not gibberish, e.g. data/baselines/table.rs will conflict with database/line/stable.rs.

When the hash codes of two paths collide, rustc substitutes the first file's contents when compiling the second one.


Rust issue

Из-за небольшого смешивания стейта просто совпадения текста без сепараторов недостаточно, нужно ещё, чтобы звёзды сошлись по длине компонентов.
GitHub miscompilation via engineered StableSourceFileId hash collisions · Issue #164348 · rust-lang/rust rustc uses the Path hash code to identify files, and the Path hash implementation is particularly weak because it ignores separators. As of PR #127297, it tries to compensate by mixing the componen...
  • 🤯 3
  • 🤣 1
More from @dereference_pointer_there
  1. Oct 15, 2026#python #meme
  2. Oct 14, 2026r/rust (потому что написано вроде на Tauri)
  3. Oct 14, 2026advanced <...> technology such as a shopping cart
  4. Oct 14, 2026Source
  5. Oct 14, 2026#prog #rust #rustasync #article Tokio Gives Progress, Not Ordering: Scheduling 1M Tasks TL…
  6. Oct 14, 2026#game Slay the Spire 2
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →