]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/option_as_ref_deref.rs
Move MSRV tests into the lint specific test files
[rust.git] / tests / ui / option_as_ref_deref.rs
index 3bf5f715f8339525b8ad547d75eea77a96b0c1f2..ba3a2eedc225cf42b27803ce102c4a4713344fb6 100644 (file)
@@ -1,6 +1,7 @@
 // run-rustfix
 
-#![allow(unused_imports, clippy::redundant_clone)]
+#![feature(custom_inner_attributes)]
+#![allow(unused, clippy::redundant_clone)]
 #![warn(clippy::option_as_ref_deref)]
 
 use std::ffi::{CString, OsString};
@@ -41,4 +42,21 @@ fn main() {
 
     let _ = opt.as_ref().map(|x| &**x);
     let _ = opt.as_mut().map(|x| &mut **x);
+
+    // Issue #5927
+    let _ = opt.as_ref().map(std::ops::Deref::deref);
+}
+
+fn msrv_1_39() {
+    #![clippy::msrv = "1.39"]
+
+    let opt = Some(String::from("123"));
+    let _ = opt.as_ref().map(String::as_str);
+}
+
+fn msrv_1_40() {
+    #![clippy::msrv = "1.40"]
+
+    let opt = Some(String::from("123"));
+    let _ = opt.as_ref().map(String::as_str);
 }