-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify docs around what libcore users must declare #57255
Comments
Yes, this doc is out of date; we've now stabilized panic handling stuff, so this is what you need today https://github.com/intermezzOS/kernel/blob/master/src/panic.rs |
This now lives here: Lines 21 to 44 in aa95b96
|
This part seems to have been fixed |
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: