File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change 1+ //! Test that static data from external crates can be imported on MSVC targets.
2+ //!
3+ //! On Windows MSVC targets, static data from external rlibs must be imported
4+ //! through `__imp_<symbol>` stubs to ensure proper linking. Without this,
5+ //! the linker would fail with "unresolved external symbol" errors when trying
6+ //! to reference static data from another crate.
7+ //!
8+ //! Regression test for <https://github.com/rust-lang/rust/issues/26591>.
9+ //! Fixed in <https://github.com/rust-lang/rust/pull/28646>.
10+
111//@ run-pass
2- //@ aux-build:msvc-data-only -lib.rs
12+ //@ aux-build:msvc-static- data-import -lib.rs
313
4- extern crate msvc_data_only_lib ;
14+ extern crate msvc_static_data_import_lib ;
515
616fn main ( ) {
7- println ! ( "The answer is {} !" , msvc_data_only_lib :: FOO ) ;
17+ println ! ( "The answer is {}!" , msvc_static_data_import_lib :: FOO ) ;
818}
You can’t perform that action at this time.
0 commit comments