You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The given crate name is added to the extern prelude, which is the same as specifying extern crate within the root module.
However, if there are #[no_mangle] symbols in the crate, then consumed into a staticlib there's a difference. I don't know if this is intentional, and/or whether I'm misinterpreting the documentation, so I'm raising an issue to ask rather than filing a PR against the documentation.
The documentation for the
--extern
rustc
command line flag seems to suggest it's functionally identical toextern crate
.Specifically:
However, if there are
#[no_mangle]
symbols in the crate, then consumed into astaticlib
there's a difference. I don't know if this is intentional, and/or whether I'm misinterpreting the documentation, so I'm raising an issue to ask rather than filing a PR against the documentation.Test case here
Do this:
./build-a.sh
. This usesextern crate rlib;
and should successfully build a C executable including a Rust symbol../build-b.sh
. This uses--extern
and instead reports:rustc 1.45.0-nightly (a08c47310 2020-05-07)
The text was updated successfully, but these errors were encountered: