[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250625.083037.1910124819838055415.fujita.tomonori@gmail.com>
Date: Wed, 25 Jun 2025 08:30:37 +0900 (JST)
From: FUJITA Tomonori <fujita.tomonori@...il.com>
To: miguel.ojeda.sandonis@...il.com
Cc: a.hindborg@...nel.org, alex.gaynor@...il.com, ojeda@...nel.org,
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 23:13:49 +0200
Miguel Ojeda <miguel.ojeda.sandonis@...il.com> wrote:
> 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
Just to clarify, Delta implements Copy:
#[derive(Copy, Clone, PartialEq, PartialOrd, Eq, Ord, Debug)]
pub struct Delta {
nanos: i64,
}
But it's just i64 so your point is that there is no conceptual
ownership transfer, right?
> 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