Skip to content

Commit daa6fc5

Browse files
author
The Miri Cronjob Bot
committed
Merge from rustc
2 parents 84b10fa + 402efe7 commit daa6fc5

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#![feature(yeet_expr)]
1111
#![feature(nonzero_ops)]
1212
#![feature(let_chains)]
13-
#![feature(lint_reasons)]
13+
#![cfg_attr(bootstrap, feature(lint_reasons))]
1414
#![feature(trait_upcasting)]
1515
#![feature(strict_overflow_ops)]
1616
#![feature(is_none_or)]

tests/pass/tls/win_tls_callback.rs

Lines changed: 16 additions & 0 deletions
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() {}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
in tls_callback

0 commit comments

Comments
 (0)