diff --git a/toolchain/check/check_unit.cpp b/toolchain/check/check_unit.cpp index d515a17ec326..f3cc33bb881f 100644 --- a/toolchain/check/check_unit.cpp +++ b/toolchain/check/check_unit.cpp @@ -575,7 +575,7 @@ auto CheckUnit::CheckOverlappingImpls() -> void { // interface. We only need to compare impls within each such segment. llvm::SmallVector impls_by_interface( context_.impls().array_ref()); - llvm::sort( + llvm::stable_sort( impls_by_interface, [](const SemIR::Impl& a, const SemIR::Impl& b) { return a.interface.interface_id.index < b.interface.interface_id.index; });