diff options
Diffstat (limited to 'src/tools/clippy/tests/ui/err_expect.rs')
-rw-r--r-- | src/tools/clippy/tests/ui/err_expect.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/err_expect.rs b/src/tools/clippy/tests/ui/err_expect.rs new file mode 100644 index 000000000..bf8c3c9fb --- /dev/null +++ b/src/tools/clippy/tests/ui/err_expect.rs @@ -0,0 +1,14 @@ +// run-rustfix + +struct MyTypeNonDebug; + +#[derive(Debug)] +struct MyTypeDebug; + +fn main() { + let test_debug: Result<MyTypeDebug, u32> = Ok(MyTypeDebug); + test_debug.err().expect("Testing debug type"); + + let test_non_debug: Result<MyTypeNonDebug, u32> = Ok(MyTypeNonDebug); + test_non_debug.err().expect("Testing non debug type"); +} |