Skip to content

Commit

Permalink
Auto merge of rust-lang#3713 - rust-lang:rustup-2024-06-27, r=RalfJung
Browse files Browse the repository at this point in the history
Automatic Rustup
  • Loading branch information
bors committed Jun 27, 2024
2 parents 5011017 + fee0430 commit 3f392aa
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 4 deletions.
6 changes: 4 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
fn main() {
// Don't rebuild miri when nothing changed.
println!("cargo:rerun-if-changed=build.rs");
// Re-export the TARGET environment variable so it can
// be accessed by miri.
// Re-export the TARGET environment variable so it can be accessed by miri. Needed to know the
// "host" triple inside Miri.
let target = std::env::var("TARGET").unwrap();
println!("cargo:rustc-env=TARGET={target}");
// Allow some cfgs.
println!("cargo::rustc-check-cfg=cfg(bootstrap)");
}
2 changes: 1 addition & 1 deletion rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
c290e9de32e8ba6a673ef125fde40eadd395d170
7033f9b14a37f4a00766d6c01326600b31f3a716
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#![feature(yeet_expr)]
#![feature(nonzero_ops)]
#![feature(let_chains)]
#![feature(lint_reasons)]
#![cfg_attr(bootstrap, feature(lint_reasons))]
#![feature(trait_upcasting)]
#![feature(strict_overflow_ops)]
#![feature(is_none_or)]
Expand Down
16 changes: 16 additions & 0 deletions tests/pass/tls/win_tls_callback.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//! Ensure that we call Windows TLS callbacks in the local crate.
//@only-target-windows
// Calling eprintln in the callback seems to (re-)initialize some thread-local storage
// and then leak the memory allocated for that. Let's just ignore these leaks,
// that's not what this test is about.
//@compile-flags: -Zmiri-ignore-leaks

#[link_section = ".CRT$XLB"]
#[used] // Miri only considers explicitly `#[used]` statics for `lookup_link_section`
pub static CALLBACK: unsafe extern "system" fn(*const (), u32, *const ()) = tls_callback;

unsafe extern "system" fn tls_callback(_h: *const (), _dw_reason: u32, _pv: *const ()) {
eprintln!("in tls_callback");
}

fn main() {}
1 change: 1 addition & 0 deletions tests/pass/tls/win_tls_callback.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
in tls_callback

0 comments on commit 3f392aa

Please sign in to comment.