Pretty printers for string produce strings of invalid length
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
I tried this code:
fn main() {
let two = "2".to_string();
let three = 2;
}
I placed a breakpoint on line 3 (let three = 2;).
I expected to see the pretty printer provide a valid value for two.
Instead, this happened:
Neither Zed, VSCode nor rust-lldb provided any value for it, instead (seemingly) infinite-looping. When I removed Rust pretty printer for Strings, I noticed that the underlying vec has a pretty large length (over u32::MAX). I believe it's not actually infinite looping; the LLDB has a wrong length.
Meta
rustc --version --verbose:
rustc 1.86.0 (05f9846f8 2025-03-31)
binary: rustc
commit-hash: 05f9846f893b09a1be1fc8560e33fc3c815cfecb
commit-date: 2025-03-31
host: aarch64-apple-darwin
release: 1.86.0
LLVM version: 19.1.7
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the provided Rust program with rustc 1.86.0 on the reported target, then inspect the Rust pretty-printer path for String values and the underlying vector length shown by LLDB. Done means the String value is displayed with a valid length instead of causing Zed, VSCode, or rust-lldb to loop.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100