[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANiq72mi47p0jVoXXq1d1G+7PnHi7ngs6zTS084igfZZzzNGBw@mail.gmail.com>
Date: Tue, 29 Apr 2025 21:53:43 +0200
From: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
To: Lyude Paul <lyude@...hat.com>
Cc: Andreas Hindborg <a.hindborg@...nel.org>, rust-for-linux@...r.kernel.org,
linux-kernel@...r.kernel.org, Boqun Feng <boqun.feng@...il.com>,
FUJITA Tomonori <fujita.tomonori@...il.com>, Frederic Weisbecker <frederic@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>, Anna-Maria Behnsen <anna-maria@...utronix.de>,
John Stultz <jstultz@...gle.com>, Stephen Boyd <sboyd@...nel.org>, Miguel Ojeda <ojeda@...nel.org>,
Alex Gaynor <alex.gaynor@...il.com>, Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <benno.lossin@...ton.me>, Alice Ryhl <aliceryhl@...gle.com>,
Trevor Gross <tmgross@...ch.edu>, Danilo Krummrich <dakr@...nel.org>
Subject: Re: [PATCH v2 5/8] rust: time: Add Instant::from_nanos()
On Tue, Apr 29, 2025 at 6:01 PM Lyude Paul <lyude@...hat.com> wrote:
>
> Possibly - somehow I completely missed the invariant of 0-KTIME_MAX though.
> Seeing it know, I think that this function probably should just be unsafe. I
> can add a debug_assert!() additionally though if you think we should still
> have one
It never hurts to have the assert, even if a function is unsafe.
In fact, it would be nice to have an `unsafe_precondition_assert!` for
this, though, even if it just maps to `debug_assert!` for the moment,
similar to what `core` does. We may want eventually to differentiate
the cases at config time.
Filled:
https://github.com/Rust-for-Linux/linux/issues/1162
Cheers,
Miguel
Powered by blists - more mailing lists