[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b6bddd3ea41644b0a353b8a4b7028bdc@AcuMS.aculab.com>
Date: Thu, 22 Apr 2021 14:09:30 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Linus Walleij' <linus.walleij@...aro.org>,
Wedson Almeida Filho <wedsonaf@...gle.com>
CC: Peter Zijlstra <peterz@...radead.org>,
"ojeda@...nel.org" <ojeda@...nel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
"Greg Kroah-Hartman" <gregkh@...uxfoundation.org>,
"rust-for-linux@...r.kernel.org" <rust-for-linux@...r.kernel.org>,
linux-kbuild <linux-kbuild@...r.kernel.org>,
Linux Doc Mailing List <linux-doc@...r.kernel.org>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH 00/13] [RFC] Rust support
From: Linus Walleij
> Sent: 22 April 2021 11:03
...
> I go to patch 12/13 and I see things like this:
>
> +/// A descriptor of wrapped list elements.
> +pub trait GetLinksWrapped: GetLinks {
> + /// Specifies which wrapper (e.g., `Box` and `Arc`) wraps the list entries.
> + type Wrapped: Wrapper<Self::EntryType>;
> +}
> +
> +impl<T: ?Sized> GetLinksWrapped for Box<T>
> +where
> + Box<T>: GetLinks,
> +{
> + type Wrapped = Box<<Box<T> as GetLinks>::EntryType>;
> +}
> +
> +impl<T: GetLinks + ?Sized> GetLinks for Box<T> {
> + type EntryType = T::EntryType;
> + fn get_links(data: &Self::EntryType) -> &Links<Self::EntryType> {
> + <T as GetLinks>::get_links(data)
> + }
> +}
>
> My God. Lose the horrible CamelCase to begin with. I hope the
> language spec does not mandate that because our kernel C style
> does not use it.
That:
1) Looks as though it could be generated by token pasting in a #define.
2) Seems to be full of what look like casts.
I really wouldn't want to bump into multiple copies of it.
The other issue is that (all most) all uses of a symbol
can be found by running:
grep -r --include '*.[chsS]' '\<symbol\>' .
often used as:
vi `grep -l -r '\<symbol\>' .`
But it looks like the rust wrappers are going to break that.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Powered by blists - more mailing lists