Skip to content

core::panicking module docs are outdated #66689

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
RalfJung opened this issue Nov 24, 2019 · 2 comments
Closed

core::panicking module docs are outdated #66689

RalfJung opened this issue Nov 24, 2019 · 2 comments
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows C-bug Category: This is a bug. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@RalfJung
Copy link
Member

RalfJung commented Nov 24, 2019

The module docs at the top of https://github.com/rust-lang/rust/blob/e41ced3f8d8e2f3f377ef931458e612d5f3d1f3f/src/libcore/panicking.rs seem outdated: they mention fn panic_impl(fmt: fmt::Arguments, file_line_col: &(&'static str, u32, u32)) -> ! as the signature for the panic_impl, but the actual signature at the bottom of the same file is fn panic_impl(pi: &PanicInfo<'_>) -> !.

The comment also says that it does not allow failing with a Box<Any> value, but PanicInfo contains something very similar, a &'a (dyn Any + Send).

I would send a PR adjusting the signature, but the second makes be belief someone with some actual knowledge of our panicking infrastructure should look at this.

Cc @alexcrichton

@jonas-schievink jonas-schievink added A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows C-bug Category: This is a bug. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Nov 24, 2019
@alexcrichton
Copy link
Member

Yes the signature has bitrotted over time and just needs an update, the bit about Box is libcore-specific and still accurate though.

@Mark-Simulacrum
Copy link
Member

I think #66694 updated the comments as needed and seems consistent with the state of the world today, so closing (but feel free to reopen of course if I'm wrong!)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows C-bug Category: This is a bug. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants