]> git.lizzy.rs Git - rust.git/commitdiff
Update clippy to new ExprUseVisitor delegate
authorEric Holk <ericholk@microsoft.com>
Sat, 26 Feb 2022 01:13:53 +0000 (17:13 -0800)
committerEric Holk <ericholk@microsoft.com>
Mon, 7 Mar 2022 17:43:27 +0000 (09:43 -0800)
clippy_lints/src/escape.rs
clippy_lints/src/loops/mut_range_bound.rs
clippy_lints/src/needless_pass_by_value.rs
clippy_utils/src/sugg.rs
clippy_utils/src/usage.rs

index af591dd71aa1d37d383570065195df3d6b637821..5974b67eb7285a27005a5f2f2fffff7c60f3e603 100644 (file)
@@ -154,7 +154,7 @@ fn consume(&mut self, cmt: &PlaceWithHirId<'tcx>, _: HirId) {
         }
     }
 
-    fn borrow(&mut self, cmt: &PlaceWithHirId<'tcx>, _: HirId, _: ty::BorrowKind) {
+    fn borrow(&mut self, cmt: &PlaceWithHirId<'tcx>, _: HirId, _: ty::BorrowKind, _is_autoref: bool) {
         if cmt.place.projections.is_empty() {
             if let PlaceBase::Local(lid) = cmt.place.base {
                 self.set.remove(&lid);
index 9d8679d77c6d02590737d25a19de817cb6e6f679..4b3d7c1ef247a88ab102bef6753887027176432e 100644 (file)
@@ -90,7 +90,7 @@ struct MutatePairDelegate<'a, 'tcx> {
 impl<'tcx> Delegate<'tcx> for MutatePairDelegate<'_, 'tcx> {
     fn consume(&mut self, _: &PlaceWithHirId<'tcx>, _: HirId) {}
 
-    fn borrow(&mut self, cmt: &PlaceWithHirId<'tcx>, diag_expr_id: HirId, bk: ty::BorrowKind) {
+    fn borrow(&mut self, cmt: &PlaceWithHirId<'tcx>, diag_expr_id: HirId, bk: ty::BorrowKind, _is_autoref: bool) {
         if bk == ty::BorrowKind::MutBorrow {
             if let PlaceBase::Local(id) = cmt.place.base {
                 if Some(id) == self.hir_id_low && !BreakAfterExprVisitor::is_found(self.cx, diag_expr_id) {
index ebfd908a6fb741692149fe5a491bf1612680221a..ccd355f480a6255a3d16c0a6126e339e80ccd57a 100644 (file)
@@ -332,7 +332,7 @@ fn consume(&mut self, cmt: &euv::PlaceWithHirId<'tcx>, _: HirId) {
         self.move_common(cmt);
     }
 
-    fn borrow(&mut self, _: &euv::PlaceWithHirId<'tcx>, _: HirId, _: ty::BorrowKind) {}
+    fn borrow(&mut self, _: &euv::PlaceWithHirId<'tcx>, _: HirId, _: ty::BorrowKind, _is_autoref: bool) {}
 
     fn mutate(&mut self, _: &euv::PlaceWithHirId<'tcx>, _: HirId) {}
 
index 63c442e70085a1015825b4731f3b079ccd985af1..0e97d837ec59efa75c9dfa8aa758f3c0b87f21b1 100644 (file)
@@ -886,7 +886,7 @@ impl<'tcx> Delegate<'tcx> for DerefDelegate<'_, 'tcx> {
     fn consume(&mut self, _: &PlaceWithHirId<'tcx>, _: HirId) {}
 
     #[allow(clippy::too_many_lines)]
-    fn borrow(&mut self, cmt: &PlaceWithHirId<'tcx>, _: HirId, _: ty::BorrowKind) {
+    fn borrow(&mut self, cmt: &PlaceWithHirId<'tcx>, _: HirId, _: ty::BorrowKind, _is_autoref: bool) {
         if let PlaceBase::Local(id) = cmt.place.base {
             let map = self.cx.tcx.hir();
             let span = map.span(cmt.hir_id);
index 405e306359bc9b2dfe46278b43c4d5e3c6307a90..ae4ca77e48c379788460175a5cf41f03714d9109 100644 (file)
@@ -64,7 +64,7 @@ fn update(&mut self, cat: &PlaceWithHirId<'tcx>) {
 impl<'tcx> Delegate<'tcx> for MutVarsDelegate {
     fn consume(&mut self, _: &PlaceWithHirId<'tcx>, _: HirId) {}
 
-    fn borrow(&mut self, cmt: &PlaceWithHirId<'tcx>, _: HirId, bk: ty::BorrowKind) {
+    fn borrow(&mut self, cmt: &PlaceWithHirId<'tcx>, _: HirId, bk: ty::BorrowKind, _is_autoref: bool) {
         if bk == ty::BorrowKind::MutBorrow {
             self.update(cmt);
         }