about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2021-12-03 18:00:41 +0100
committerGuillaume Gomez <guillaume.gomez@huawei.com>2021-12-08 11:16:14 +0100
commite93767b395ca18ac895e0d52520c2586b7aae0e6 (patch)
tree99a8f37de11ec33371be3ca459ec8e79e0037c65
parent2b35edbb84c6de7bdd253d56ea4a7b2c50a1513a (diff)
downloadrust-e93767b395ca18ac895e0d52520c2586b7aae0e6.tar.gz
rust-e93767b395ca18ac895e0d52520c2586b7aae0e6.zip
Apply new lint on clippy source code
-rw-r--r--clippy_utils/src/hir_utils.rs2
-rw-r--r--clippy_utils/src/sugg.rs1
2 files changed, 3 insertions, 0 deletions
diff --git a/clippy_utils/src/hir_utils.rs b/clippy_utils/src/hir_utils.rs
index 7438b6eabf9..c1eaa5c5185 100644
--- a/clippy_utils/src/hir_utils.rs
+++ b/clippy_utils/src/hir_utils.rs
@@ -41,6 +41,7 @@ impl<'a, 'tcx> SpanlessEq<'a, 'tcx> {
     }
 
     /// Consider expressions containing potential side effects as not equal.
+    #[must_use]
     pub fn deny_side_effects(self) -> Self {
         Self {
             allow_side_effects: false,
@@ -48,6 +49,7 @@ impl<'a, 'tcx> SpanlessEq<'a, 'tcx> {
         }
     }
 
+    #[must_use]
     pub fn expr_fallback(self, expr_fallback: impl FnMut(&Expr<'_>, &Expr<'_>) -> bool + 'a) -> Self {
         Self {
             expr_fallback: Some(Box::new(expr_fallback)),
diff --git a/clippy_utils/src/sugg.rs b/clippy_utils/src/sugg.rs
index 872942685f0..586934df460 100644
--- a/clippy_utils/src/sugg.rs
+++ b/clippy_utils/src/sugg.rs
@@ -294,6 +294,7 @@ impl<'a> Sugg<'a> {
     /// Adds parentheses to any expression that might need them. Suitable to the
     /// `self` argument of a method call
     /// (e.g., to build `bar.foo()` or `(1 + 2).foo()`).
+    #[must_use]
     pub fn maybe_par(self) -> Self {
         match self {
             Sugg::NonParen(..) => self,