Open
Description
This is most likely responsible for the windows failures from #43931 when the __getit
function, which may return a reference to a #[thread_local] static
, was #[inline]
(cc @alexcrichton):
// a.rs
#![crate_type = "dylib"]
#![feature(thread_local)]
#[thread_local]
static FOO: u32 = 25;
pub fn addr() -> *const u32 {
&FOO
}
#[inline]
pub fn addr_inline() -> *const u32 {
&FOO
}
// b.rs
extern crate a;
fn main() {
assert_eq!(a::addr(), a::addr_inline());
}
Running b
, on x64 MSVC (thanks, @bcata6!) results in:
thread 'main' panicked at 'assertion failed: `(left == right)`
left: `0x134cb61ace4`,
right: `0x134cb6139c0`', b.rs:4:4