-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-FFIArea: Foreign function interface (FFI)Area: Foreign function interface (FFI)A-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.
Description
#[no_mangle]
pub const THING: libc::c_int = 42;
Will not actually be exported in the resulting object. There are two obvious fixes, the first being to expand on my pub-not-exported lint to warn you that this will not work, the second being to fix the compiler to export the symbol with the appropriate value (Without altering the existing inlining behaviour, although it may give a more reasonable option for cases like trying to take the address of a const
item).
Happy to work on either, although I would need a mentor for the second part.
Metadata
Metadata
Assignees
Labels
A-FFIArea: Foreign function interface (FFI)Area: Foreign function interface (FFI)A-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.