]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/needless_question_mark.rs
fix `needless_question_mark` not considering async fn
[rust.git] / tests / ui / needless_question_mark.rs
index 44a0c5f61b5d5f71c9d6d7ebdc3eea35bb423572..3a6523e8fe872a94b172c851d1c997f9a1ed9350 100644 (file)
@@ -125,3 +125,16 @@ pub fn test2() {
     let x = Some(3);
     let _x = some_and_qmark_in_macro!(x?);
 }
+
+async fn async_option_bad(to: TO) -> Option<usize> {
+    let _ = Some(3);
+    Some(to.magic?)
+}
+
+async fn async_deref_ref(s: Option<&String>) -> Option<&str> {
+    Some(s?)
+}
+
+async fn async_result_bad(s: TR) -> Result<usize, bool> {
+    Ok(s.magic?)
+}