Skip to content

Export #[inline] fns with extern indicators#73034

Merged
bors merged 7 commits intorust-lang:masterfrom
cofibrant:nomangle-inline-linkage
Jun 19, 2020
Merged

Export #[inline] fns with extern indicators#73034
bors merged 7 commits intorust-lang:masterfrom
cofibrant:nomangle-inline-linkage

Conversation

@cofibrant
Copy link
Contributor

In ancient history (#36280) we stopped #[inline] fns being codegened if they weren't used. However,

observe that when writing something like

#![crate_type = "cdylib"]

#[no_mangle]
#[inline]
pub extern "C" fn foo() {
    // ...
}

we really do want foo to be codegened. This change makes this the case.

Resolves #72944, resolves #72463 (and maybe some more)

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Warn if a function is marked as both #[inline] and #[no_mangle] #[inline] prevents symbol from appearing in staticlib output