rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
99.01k stars 12.79k forks source link

std::thread: avoid leading whitespace in some panic messages #133464

Closed RalfJung closed 3 days ago

RalfJung commented 4 days ago

This:

        panic!(
            "use of std::thread::current() is not possible after the thread's
         local data has been destroyed"
        )

will print a newline followed by a bunch of spaces, since the entire string literal is interpreted literally.

I think the intention was to print the message without the newline and the spaces, so let's add some \ to make that happen.

r? @joboet

joboet commented 4 days ago

Yeah, that wasn't on purpose... 😄 thank you! @bors r+ rollup

bors commented 4 days ago

:pushpin: Commit 8bc8adb8dcaa268e2b2bd9093f8f4f4bcb0b1a45 has been approved by joboet

It is now in the queue for this repository.