]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/unnecessary_lazy_eval.rs
Move MSRV tests into the lint specific test files
[rust.git] / tests / ui / unnecessary_lazy_eval.rs
index f70cf332460e1efa9f805d1ba956e8b798934bf6..59cdf66285463e3e69dcb750cdcb194ce0ca7066 100644 (file)
@@ -1,9 +1,13 @@
 // run-rustfix
+// aux-build: proc_macro_with_span.rs
 #![warn(clippy::unnecessary_lazy_evaluations)]
 #![allow(clippy::redundant_closure)]
 #![allow(clippy::bind_instead_of_map)]
 #![allow(clippy::map_identity)]
 
+extern crate proc_macro_with_span;
+use proc_macro_with_span::with_span;
+
 struct Deep(Option<usize>);
 
 #[derive(Copy, Clone)]
@@ -141,3 +145,9 @@ fn main() {
     let _: Result<usize, usize> = res.and_then(|x| Err(x));
     let _: Result<usize, usize> = res.or_else(|err| Ok(err));
 }
+
+#[allow(unused)]
+fn issue9485() {
+    // should not lint, is in proc macro
+    with_span!(span Some(42).unwrap_or_else(|| 2););
+}