Skip to content

Commit 858c623

Browse files
committed
Auto merge of #126979 - matthiaskrgr:rollup-fdqledz, r=matthiaskrgr
Rollup of 10 pull requests Successful merges: - #126724 (Fix a span in `parse_ty_bare_fn`.) - #126812 (Rename `tcx` to `cx` in new solver generic code) - #126879 (fix Drop items getting leaked in Filter::next_chunk) - #126925 (Change E0369 to give note informations for foreign items.) - #126938 (miri: make sure we can find link_section statics even for the local crate) - #126954 (resolve: Tweak some naming around import ambiguities) - #126964 (Migrate `lto-empty`, `invalid-so` and `issue-20626` `run-make` tests to rmake.rs) - #126968 (Don't ICE during RPITIT refinement checking for resolution errors after normalization) - #126971 (Bump black, ruff and platformdirs) - #126973 (Fix bad replacement for unsafe extern block suggestion) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 4c849ed + 3bdc93d commit 858c623

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

tests/pass/tls/win_tls_callback.rs

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//! Ensure that we call Windows TLS callbacks in the local crate.
2+
//@only-target-windows
3+
// Calling eprintln in the callback seems to (re-)initialize some thread-local storage
4+
// and then leak the memory allocated for that. Let's just ignore these leaks,
5+
// that's not what this test is about.
6+
//@compile-flags: -Zmiri-ignore-leaks
7+
8+
#[link_section = ".CRT$XLB"]
9+
#[used] // Miri only considers explicitly `#[used]` statics for `lookup_link_section`
10+
pub static CALLBACK: unsafe extern "system" fn(*const (), u32, *const ()) = tls_callback;
11+
12+
unsafe extern "system" fn tls_callback(_h: *const (), _dw_reason: u32, _pv: *const ()) {
13+
eprintln!("in tls_callback");
14+
}
15+
16+
fn main() {}
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
in tls_callback

0 commit comments

Comments
 (0)