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