-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Closed
Labels
C-bugCategory: This is a bug.Category: This is a bug.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.
Description
Reproducer (nightly 1.91):
fn main() {
_ = &std::path::PathBuf::from("x") == "-";
}
or
fn main() {
_ = "-" == &std::path::PathBuf::from("x");
}
When run, it leads to a stack overflow. Output in debug mode (hangs in release):
thread 'main' (157) has overflowed its stack
fatal runtime error: stack overflow, aborting
_ = std::path::Path::new("x") == "-";
does not reproduce this stack overflow.
Neither does this: _ = &std::path::PathBuf::from("x") == std::path::Path::new("-");
.
This might be related to the recent addition of PartialEq<str> for Path
, PartialEq<str> for PathBuf
and friends on nightly (1.91).
rustc 1.91.0-nightly (51ff89506 2025-09-02)
binary: rustc
commit-hash: 51ff895062ba60a7cba53f57af928c3fb7b0f2f4
commit-date: 2025-09-02
host: x86_64-unknown-linux-gnu
release: 1.91.0-nightly
LLVM version: 21.1.0
Also reproduces on the playground (nightly).
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.