rust-lang / rust-lang/rust

`core::panic::PanicInfo`'s `location` method show incorrect usage with `std::panic::set_hook`, even though that functionality has been split

Open Beginner friendly
#128,788 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-docs T-libs
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Location

https://doc.rust-lang.org/beta/core/panic/struct.PanicInfo.html#method.location
https://github.com/rust-lang/rust/blob/9bad7ba324099d124c77c5b06aebf68e11763f7b/library/core/src/panic/panic_info.rs#L65-L95

Summary

since #115974 the PanicInfo and PanicHookInfo structs have been split up, but the docs for PanicInfo still show how to use it with a panic hook, even though it is now exclusively for the #[panic_handler] and the panic hook functionality has been moved into PanicHookInfo

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the documentation around the location method in library/core/src/panic/panic_info.rs at the referenced lines. Update the example so panic-hook usage refers to PanicHookInfo rather than PanicInfo, then verify the rendered documentation no longer shows the outdated usage.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.