Improve No stdlib and related Documentation#35663
Conversation
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Manishearth (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
|
|
||
| // This function may be needed based on the compilation target. | ||
| #[lang = "eh_unwind_resume"] | ||
| #[no_mangle] |
There was a problem hiding this comment.
#[no_mangle] seems questionable, as this is not done in libpanic_unwind. The extern "C" might already indicate that those functions are not supposed to be mangled. I'm not quite sure on that though, so I kept it for now.
There was a problem hiding this comment.
[steve@becoming tmp]$ cat foo.rs
pub extern fn mangle() {}
#[no_mangle]
pub extern fn no_mangle() {}
[steve@becoming tmp]$ rustc foo.rs --crate-type=lib
[steve@becoming tmp]$ nm libfoo.rlib | grep mangle
nm: rust.metadata.bin: File format not recognized
0000000000000000 T no_mangle
0000000000000000 T _ZN3foo6mangle17h47460733e6635b5fE
nm: foo.0.bytecode.deflate: File format not recognized(extern does not imply no_mangle)
There was a problem hiding this comment.
I guess, it's questionable if you need it for a lang_item however, as there's no actual C code that needs the actual symbol name though. You can even choose your own apparently.
|
Not so sure if we should be renaming them. AIUI |
|
Well, the documentation also has |
|
@bors r+ rollup fair |
|
📌 Commit e586d21 has been approved by |
Improve `No stdlib` and related Documentation This renames all lang item function names to the ones used in `libstd` and `libpanic_unwind`. It also explains the `eh_unwind_resume` lang item in the `libcore` documentation, where it was missing. A third function is also needed on certain compilation targets, so this was also added to the `No stdlib` documentation.
Improve `No stdlib` and related Documentation This renames all lang item function names to the ones used in `libstd` and `libpanic_unwind`. It also explains the `eh_unwind_resume` lang item in the `libcore` documentation, where it was missing. A third function is also needed on certain compilation targets, so this was also added to the `No stdlib` documentation.
Improve `No stdlib` and related Documentation This renames all lang item function names to the ones used in `libstd` and `libpanic_unwind`. It also explains the `eh_unwind_resume` lang item in the `libcore` documentation, where it was missing. A third function is also needed on certain compilation targets, so this was also added to the `No stdlib` documentation.
This renames all lang item function names to the ones used in
libstdandlibpanic_unwind. It also explains theeh_unwind_resumelang item in thelibcoredocumentation, where it was missing. A third function is also needed on certain compilation targets, so this was also added to theNo stdlibdocumentation.