Skip to content

cargo fmt crashes in Rust 1.81.0 #6333

Closed
@ajewellamz

Description

@ajewellamz

lib.rs.gz

Un-gzip the attached lib.rs
make it the only file in a crate
run cargo fmt
See

thread 'main' panicked at library/core/src/slice/sort/shared/smallsort.rs:862:5:
user-provided comparison function does not correctly implement a total order
stack backtrace:
   0:        0x103e69aa3 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::haf41a54e7ed5fe07
   1:        0x103eb45cb - core::fmt::write::h526161fad96c5ad5
   2:        0x103e5f69e - std::io::Write::write_fmt::h4de0398536c8b0e4

As an aside - with previous versions of Rust, cargo fmt also failed on this file.
It didn't crash, but it left trailing spaces on some lines, and then reported failure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugPanic, non-idempotency, invalid code, etc.help wanted

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions