If you write the following code, the a == b will not specialize to pointer comparisons purely because str is unsized. If a String were used, the address would be compared.
let a: Rc<str> = "example".into();
let b = Rc::clone(a);
a == b;
You can see an example on Godbolt here: https://godbolt.org/z/qeKMYvPo1.
The bug itself narrows down to, as far as I can see, the following code using T: Eq instead of T: ?Sized + Eq. Notably the code just below uses ?Sized + MarkerEq, which will never occur unless a std type were to manually implement MarkerEq for some reason, leading me to believe that this is likely an unintended for this bound to fail on unsized types.
Meta
rustc --version --verbose:
rustc 1.94.0 (4a4ef493e 2026-03-02)
binary: rustc
commit-hash: 4a4ef493e3a1488c6e321570238084b38948f6db
commit-date: 2026-03-02
host: x86_64-pc-windows-msvc
release: 1.94.0
LLVM version: 21.1.8
If you write the following code, the
a == bwill not specialize to pointer comparisons purely becausestris unsized. If aStringwere used, the address would be compared.You can see an example on Godbolt here: https://godbolt.org/z/qeKMYvPo1.
The bug itself narrows down to, as far as I can see, the following code using
T: Eqinstead ofT: ?Sized + Eq. Notably the code just below uses?Sized + MarkerEq, which will never occur unless a std type were to manually implementMarkerEqfor some reason, leading me to believe that this is likely an unintended for this bound to fail on unsized types.Meta
rustc --version --verbose: