[v2,0/2] rust: sync: Arc: Implement Debug and Display

Message ID 20230207185216.1314638-1-boqun.feng@gmail.com
Headers
Series rust: sync: Arc: Implement Debug and Display |

Message

Boqun Feng Feb. 7, 2023, 6:52 p.m. UTC
  previous version:

v1:	https://lore.kernel.org/rust-for-linux/20230201232244.212908-1-boqun.feng@gmail.com/	

Changes since v1:

*	Remove the refcount for Debug impl as per Peter and Greg.
*	Since the refcount_read() bits are removed, therefore squash all
	4 patches into one (I keep the Reviewed-by tags for anyone that
	gave to both patch #1 and patch #4 in v1). Thanks for everyone
	for the reviewing ;-)


I found that our Arc doesn't implement `Debug` or `Display` when I tried
to play with them, therefore add these implementation.

With these changes, I could get the following print with the sample code
in patch #2:

	[..] rust_print: 1
	[..] rust_print: "hello, world"
	[..] rust_print: [samples/rust/rust_print.rs:34] c = "hello, world"
	[..] rust_print: "hello, world"

Suggestions and comments are welcome!

Regards,
Boqun
  

Comments

Miguel Ojeda April 10, 2023, 2:53 a.m. UTC | #1
On Tue, Feb 7, 2023 at 7:52 PM Boqun Feng <boqun.feng@gmail.com> wrote:
>
> I found that our Arc doesn't implement `Debug` or `Display` when I tried
> to play with them, therefore add these implementation.

Applied to `rust-next` (with the few changes mentioned). Thanks!

Cheers,
Miguel