]> git.lizzy.rs Git - rust.git/blob - tests/debuginfo/result-types.rs
Rollup merge of #107807 - GuillaumeGomez:fix-small-debug-typo, r=notriddle
[rust.git] / tests / debuginfo / result-types.rs
1 // cdb-only
2 // min-cdb-version: 10.0.18317.1001
3 // compile-flags:-g
4
5 // === CDB TESTS ==================================================================================
6
7 // cdb-command: g
8
9 // cdb-command: dx x,d
10 // cdb-check:x,d              : Ok [Type: enum2$<core::result::Result<i32,ref$<str$> > >]
11 // cdb-check:    [...] __0              : -3 [Type: int]
12
13 // cdb-command: dx y
14 // cdb-check:y                : Err [Type: enum2$<core::result::Result<i32,ref$<str$> > >]
15 // cdb-check:    [...] __0              : "Some error message" [Type: ref$<str$>]
16
17 fn main() {
18     let x: Result<i32, &str> = Ok(-3);
19     assert_eq!(x.is_ok(), true);
20
21     let y: Result<i32, &str> = Err("Some error message");
22     assert_eq!(y.is_ok(), false);
23
24     zzz(); // #break.
25 }
26
27 fn zzz() {
28     ()
29 }