rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Remove `ArcBorrow`
@ 2023-09-21 21:34 Wedson Almeida Filho
  2023-09-21 21:34 ` [PATCH 1/2] rust: arc: rename `ArcInner` to `WithRef` Wedson Almeida Filho
  2023-09-21 21:34 ` [PATCH 2/2] rust: arc: remove `ArcBorrow` in favour of `WithRef` Wedson Almeida Filho
  0 siblings, 2 replies; 22+ messages in thread
From: Wedson Almeida Filho @ 2023-09-21 21:34 UTC (permalink / raw)
  To: rust-for-linux
  Cc: Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	linux-kernel, Wedson Almeida Filho

From: Wedson Almeida Filho <walmeida@microsoft.com>

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

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            | 192 ++++++++++-------------------
 rust/kernel/sync/arc/std_vendor.rs |   4 +-
 3 files changed, 70 insertions(+), 128 deletions(-)


base-commit: 0bb80ecc33a8fb5a682236443c1e740d5c917d1d
-- 
2.34.1


^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2023-09-23 14:20 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-21 21:34 [PATCH 0/2] Remove `ArcBorrow` Wedson Almeida Filho
2023-09-21 21:34 ` [PATCH 1/2] rust: arc: rename `ArcInner` to `WithRef` Wedson Almeida Filho
2023-09-21 21:47   ` Finn Behrens
2023-09-22  7:50   ` Benno Lossin
2023-09-22 15:26   ` Alice Ryhl
2023-09-22 22:52   ` Martin Rodriguez Reboredo
2023-09-23  0:06   ` Gary Guo
2023-09-21 21:34 ` [PATCH 2/2] rust: arc: remove `ArcBorrow` in favour of `WithRef` Wedson Almeida Filho
2023-09-22  8:53   ` Benno Lossin
2023-09-23 14:01     ` Wedson Almeida Filho
2023-09-22 15:29   ` Alice Ryhl
2023-09-22 19:50     ` Benno Lossin
2023-09-23 14:07       ` Wedson Almeida Filho
2023-09-22 22:55     ` Martin Rodriguez Reboredo
2023-09-23  0:16     ` Gary Guo
2023-09-22 22:53   ` Martin Rodriguez Reboredo
2023-09-23  0:12   ` Gary Guo
2023-09-23 14:11     ` Wedson Almeida Filho
2023-09-23 14:15       ` Alice Ryhl
2023-09-23 14:20         ` Wedson Almeida Filho
2023-09-23  5:16   ` Jianguo Bao
2023-09-23 14:12     ` Wedson Almeida Filho

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).