Clarify docs around what libcore users must declare #57255
Labels
A-docs
Area: Documentation for any part of the project, including the compiler, standard library, and tools
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
I find the documentation about what libcore depends on a bit confusing right now. I'm trying to make my
#[no_std]
crate compile after a year on inactivity for context.Now firstly, this section describes several symbols, but is the actual symbol name relevant (ignoring
memcpy
/memset
/etc)? Or do we only care about the existence of some function labeled with the appropriate attribute? The distinction between symbol name and the associated lang attribute is confusing here.It appears that the
#[lang="panic_impl"]
mentioned is already declared inlibcore/panicking.rs
. It appears that this should refer to#[lang = "panic_fmt"]
instead, which is whatlibcore
users formerly had to declare but is now implicitly declared by by the new#[panic_handler]
. Rustc will complain about missing a#[panic_handler]
currently. So this section should probably be updated to refer to#[panic_handler]
instead.It should probably be mentioned that
#[lang="eh_personality"]
seems only necessary ifpanic=unwind
. Additionally should perhaps mention_Unwind_Resume
as well (which theoretically is only necessary forpanic=unwind
builds but can erroneously be required forpanic=abort opt-level=0
builds see #53301). There's actually more of theseeh
functions that should be perhaps mentioned depending on your target. The subtleties are explained inlibpanic_unwind
andlibpanic_abort
.Along the same lines, the docs of
liballoc
should probably also mention#[alloc_error_handler]
(see #51540).I can try writing up a draft or PR but wanted to get feedback first.
The text was updated successfully, but these errors were encountered: