]> git.lizzy.rs Git - rust.git/blob - src/test/debuginfo/mutex.rs
Rollup merge of #88986 - hargoniX:master, r=Mark-Simulacrum
[rust.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 // FIXME: Failed on update to 10.0.22000.1
7 // ignore-windows
8
9 // === CDB TESTS ==================================================================================
10 //
11 // cdb-command:g
12 //
13 // cdb-command:dx m,d
14 // cdb-check:m,d              [Type: std::sync::mutex::Mutex<i32>]
15 // cdb-check:    [...] inner            [Type: std::sys_common::mutex::MovableMutex]
16 // cdb-check:    [...] poison           [Type: std::sync::poison::Flag]
17 // cdb-check:    [...] data             [Type: core::cell::UnsafeCell<i32>]
18
19 //
20 // cdb-command:dx m.data,d
21 // cdb-check:m.data,d         [Type: core::cell::UnsafeCell<i32>]
22 // cdb-check:    [...] value            : 0 [Type: int]
23
24 //
25 // cdb-command:dx lock,d
26 // 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> > >]
27 // cdb-check:    [...] variant$         : Ok (0) [Type: core::result::Result]
28 // cdb-check:    [...] __0              [Type: std::sync::mutex::MutexGuard<i32>]
29
30 use std::sync::Mutex;
31
32 #[allow(unused_variables)]
33 fn main()
34 {
35     let m = Mutex::new(0);
36     let lock = m.try_lock();
37     zzz(); // #break
38 }
39
40 fn zzz() {}