]> git.proxmox.com Git - rustc.git/blob - src/test/debuginfo/mutex.rs
New upstream version 1.57.0+dfsg1
[rustc.git] / src / test / debuginfo / mutex.rs
1 // Testing the display of Mutex and MutexGuard in cdb.
2
3 // cdb-only
4 // min-cdb-version: 10.0.21287.1005
5 // compile-flags:-g
6
7 // === CDB TESTS ==================================================================================
8 //
9 // cdb-command:g
10 //
11 // cdb-command:dx m,d
12 // cdb-check:m,d [Type: std::sync::mutex::Mutex<i32>]
13 // cdb-check: [...] inner [Type: std::sys_common::mutex::MovableMutex]
14 // cdb-check: [...] poison [Type: std::sync::poison::Flag]
15 // cdb-check: [...] data : 0 [Type: core::cell::UnsafeCell<i32>]
16
17 //
18 // cdb-command:dx m.data,d
19 // cdb-check:m.data,d : 0 [Type: core::cell::UnsafeCell<i32>]
20 // cdb-check: [<Raw View>] [Type: core::cell::UnsafeCell<i32>]
21
22 //
23 // cdb-command:dx lock,d
24 // cdb-check:lock,d : Ok [Type: enum$<core::result::Result<std::sync::mutex::MutexGuard<i32>,enum$<std::sync::poison::TryLockError<std::sync::mutex::MutexGuard<i32> >, 0, 1, Poisoned> > >]
25 // cdb-check: [variant] : Ok
26 // cdb-check: [...] __0 [Type: std::sync::mutex::MutexGuard<i32>]
27
28 use std::sync::Mutex;
29
30 #[allow(unused_variables)]
31 fn main()
32 {
33 let m = Mutex::new(0);
34 let lock = m.try_lock();
35 zzz(); // #break
36 }
37
38 fn zzz() {}