lkml.org 
[lkml]   [2024]   [Apr]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v4 4/4] rust: add abstraction for `struct page`
On Sun, Apr 7, 2024 at 10:59 AM Benno Lossin <benno.lossin@proton.me> wrote:
>
> On 05.04.24 09:44, Alice Ryhl wrote:
> > On Fri, Apr 5, 2024 at 12:33 AM Benno Lossin <benno.lossin@proton.me> wrote:
> >>
> >> On 04.04.24 14:31, Alice Ryhl wrote:
> >>> +/// A bitwise shift for the page size.
> >>> +#[allow(clippy::unnecessary_cast)]
> >>
> >> Why can't you remove the cast?
> >
> > Bindgen could decide to use a different type in the future or on
> > different platforms.
>
> Did that already happen?
>
> I think that we might want to know if the type changes, since then the
> value might change?

I mean, it's quite unlikely that the page size will not fit in an
usize, even if it changes?

From bindgen's point of view, this constant is just an integer literal
with no type information. So I don't see how we can expect it to
always be generated as a usize?

Alice

\
 
 \ /
  Last update: 2024-05-27 16:28    [from the cache]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog