Skip to content

Remove `ArcBorrow`

Wedson Almeida Filho lkml rust-for-linux 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 38 repliesIn review
  2. v12 patches 19 repliesSuperseded

Changes in v2 from the cover letter

* Moved the definition of WithRef to where ArcBorrow was.
* Updated documentation of as_arc_borrow.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2rust: arc: rename `ArcInner` to `WithRef`rust/kernel/sync/arc.rs rust/kernel/sync/arc/std_vendor.rs+12 -124 replies
2/2rust: arc: remove `ArcBorrow` in favour of `WithRef`rust/kernel/sync.rs rust/kernel/sync/arc.rs+39 -9734 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchMartin Rodriguez ReboredoBenno LossinJianguo BaoAlice Ryhl
1/2R-b R-b R-b R-b
2/2R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v2 thread

Cover letter [PATCH v2 0/2] Remove `ArcBorrow`

From: Wedson Almeida Filho <[email protected]>

In this small series we remove ArcBorrow<'_, T> and replace it with &WithRef<T>, which we used to call ArcInner -- it is renamed because it is now public, so we chose a more meaningful name.

This simplifies the code because we remove a type and have simpler syntax to refer to borrowed arcs: ArcBorrow<'a, T> vs &'a WithRef<T>.

This became possible when we adopted GATs in 2021 but we only realised it recently (thanks Boqun!), more details on this zulip thread:
https://rust-for-linux.zulipchat.com/#narrow/stream/291566-Library/topic/Isn't.20.60ArcBorrow.60.20just.20.60.26ArcInner.3CT.3E.60.3F

Changes v1 -> v2:
* Moved the definition of WithRef to where ArcBorrow was.
* Updated documentation of as_arc_borrow.

Wedson Almeida Filho (2):
rust: arc: rename ArcInner to WithRef
rust: arc: remove ArcBorrow in favour of WithRef

 rust/kernel/sync.rs                |   2 +-
 rust/kernel/sync/arc.rs            | 146 +++++++++--------------------
 rust/kernel/sync/arc/std_vendor.rs |   4 +-
 3 files changed, 47 insertions(+), 105 deletions(-)

base-commit: 0bb80ecc33a8fb5a682236443c1e740d5c917d1d

Signature · 1 line
2.34.1