]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/tests/ui/err_expect.rs
New upstream version 1.67.1+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / err_expect.rs
CommitLineData
04454e1e
FG
1// run-rustfix
2
2b03887a
FG
3#![allow(unused)]
4
04454e1e
FG
5struct MyTypeNonDebug;
6
7#[derive(Debug)]
8struct MyTypeDebug;
9
10fn 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}
2b03887a 17
487cf647 18#[clippy::msrv = "1.16"]
2b03887a 19fn msrv_1_16() {
2b03887a
FG
20 let x: Result<u32, &str> = Ok(16);
21 x.err().expect("16");
22}
23
487cf647 24#[clippy::msrv = "1.17"]
2b03887a 25fn msrv_1_17() {
2b03887a
FG
26 let x: Result<u32, &str> = Ok(17);
27 x.err().expect("17");
28}