[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANiq72kHocyULzwqxS51XeSEhsJpccfNFc+QYE67yvfvS8BApw@mail.gmail.com>
Date: Tue, 24 Jun 2025 23:13:49 +0200
From: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
To: Andreas Hindborg <a.hindborg@...nel.org>
Cc: alex.gaynor@...il.com, ojeda@...nel.org,
FUJITA Tomonori <fujita.tomonori@...il.com>, aliceryhl@...gle.com, anna-maria@...utronix.de,
bjorn3_gh@...tonmail.com, boqun.feng@...il.com, dakr@...nel.org,
frederic@...nel.org, gary@...yguo.net, jstultz@...gle.com,
linux-kernel@...r.kernel.org, lossin@...nel.org, lyude@...hat.com,
rust-for-linux@...r.kernel.org, sboyd@...nel.org, tglx@...utronix.de,
tmgross@...ch.edu
Subject: Re: [PATCH v3 0/5] rust: time: Convert hrtimer to use Instant and Delta
On Tue, 24 Jun 2025 at 15:11, Andreas Hindborg <a.hindborg@...nel.org> wrote:
>
> None of the options are the right choice.
That is fine (it is also what I have been arguing in the other thread
and in previous times), but that does not imply `into_*` is not a bad
choice if we really want to follow upstream.
> Cost and ownership _do_ line
> up for `into_*` in this case.
No, ownership definitely doesn't line up: `Delta` is not `Copy` and
there is no conceptual ownership transfer. While it says "owned ->
owned", not being `Copy` is quite important here: the guidelines
clarify in an example for a `Copy` type that if the input is not
consumed then it should not be `into_*`.
Sure, "Variable" cost means anything could go there, but that doesn't
tell us much, i.e. if it was completely free, we could just as well
pick `as_`, which would actually provide some information since you
know it needs to be cheap.
So the whole argument for `into_*` is... "it says 'Variable' cost so
it lines up"?
Now, what I argued is that we may just as well define our own rules,
since that table is confusing and doesn't cover all cases. If we do
that, then you could propose things like "all owned->owned methods are
`into_*`", which I think is what you are essentially implying here.
> I do not think that is settled.
If you think so, then the patch shouldn't be applied.
Cheers,
Miguel
Powered by blists - more mailing lists