]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/unit_arg.rs
Auto merge of #4478 - tsurai:master, r=flip1995
[rust.git] / tests / ui / unit_arg.rs
index 571882ced0f7d4985b3918aae4ef5eff93b51dfd..c15b0a50045565b691a751af079e54211030e052 100644 (file)
@@ -1,14 +1,6 @@
-// Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
+// run-rustfix
 #![warn(clippy::unit_arg)]
-#![allow(clippy::no_effect)]
+#![allow(clippy::no_effect, unused_must_use)]
 
 use std::fmt::Debug;
 
@@ -62,6 +54,17 @@ fn question_mark() -> Result<(), ()> {
     Ok(())
 }
 
+#[allow(dead_code)]
+mod issue_2945 {
+    fn unit_fn() -> Result<(), i32> {
+        Ok(())
+    }
+
+    fn fallible() -> Result<(), i32> {
+        Ok(unit_fn()?)
+    }
+}
+
 fn main() {
     bad();
     ok();