]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/err_expect.rs
Rollup merge of #105801 - zertosh:path_mut_os_str_doc_test, r=dtolnay
[rust.git] / src / tools / clippy / tests / ui / err_expect.rs
1 // run-rustfix
2
3 #![allow(unused)]
4
5 struct MyTypeNonDebug;
6
7 #[derive(Debug)]
8 struct MyTypeDebug;
9
10 fn main() {
11     let test_debug: Result<MyTypeDebug, u32> = Ok(MyTypeDebug);
12     test_debug.err().expect("Testing debug type");
13
14     let test_non_debug: Result<MyTypeNonDebug, u32> = Ok(MyTypeNonDebug);
15     test_non_debug.err().expect("Testing non debug type");
16 }
17
18 #[clippy::msrv = "1.16"]
19 fn msrv_1_16() {
20     let x: Result<u32, &str> = Ok(16);
21     x.err().expect("16");
22 }
23
24 #[clippy::msrv = "1.17"]
25 fn msrv_1_17() {
26     let x: Result<u32, &str> = Ok(17);
27     x.err().expect("17");
28 }