Re: [PATCH v2 2/2] rust: std_vendor: add `likely()`, `unlikely()` and `cold_path()`
"Gary Guo" <[email protected]>
| Newsgroups | dev.linux.lists.llvm,org.kernel.vger.rust-for-linux |
|---|---|
| Message-ID | <[email protected]> |
On Tue Apr 7, 2026 at 11:39 AM BST, Miguel Ojeda wrote: > On Mon, Apr 6, 2026 at 11:59 AM Miguel Ojeda <[email protected]> wrote: >> >> +#[cfg(CONFIG_RUSTC_HAS_COLD_PATH)] >> +pub use core::hint::cold_path; > > This works inside the `kernel` crate, but Sashiko is correct: we will > need to enable the feature to use it later. > > And while it can be done, it is not as simple as usual, because it is > conditional. > > I was already on the fence of making a single function to share the > signature anyway, so I think I will just do that in v3. It might worth adding a user for this too in v3. `warn_flags!()` would be a good example. Best, Gary