diff --git a/tests/run-pass/concurrency/concurrent_caller_location.rs b/tests/run-pass/concurrency/concurrent_caller_location.rs new file mode 100644 index 00000000000..e3e2f9ac60a --- /dev/null +++ b/tests/run-pass/concurrency/concurrent_caller_location.rs @@ -0,0 +1,17 @@ +use std::thread::spawn; +use std::panic::Location; + +fn initialize() { + let _ignore = initialize_inner(); +} + +fn initialize_inner() -> &'static Location<'static> { + Location::caller() +} + +fn main() { + let j1 = spawn(initialize); + let j2 = spawn(initialize); + j1.join().unwrap(); + j2.join().unwrap(); +} diff --git a/tests/run-pass/concurrency/concurrent_caller_location.stderr b/tests/run-pass/concurrency/concurrent_caller_location.stderr new file mode 100644 index 00000000000..03676519d4f --- /dev/null +++ b/tests/run-pass/concurrency/concurrent_caller_location.stderr @@ -0,0 +1,2 @@ +warning: thread support is experimental and incomplete: weak memory effects are not emulated. +