rust: kernel: mark as #[inline] all From::from()s for Error#126
Open
alistair23 wants to merge 1 commit intoRust-for-Linux:mainfrom
Open
rust: kernel: mark as #[inline] all From::from()s for Error#126alistair23 wants to merge 1 commit intoRust-for-Linux:mainfrom
#[inline] all From::from()s for Error#126alistair23 wants to merge 1 commit intoRust-for-Linux:mainfrom
Conversation
nbdd0121
reviewed
Apr 14, 2026
Member
nbdd0121
left a comment
There was a problem hiding this comment.
I don't think these #[inline]s are useful given it's only in examples, but I don't think these'll hurt either.
Anyhow, please adjust your commit summary and message to quote code blocks properly and to use lore link. You can see the commit message that Miguel fixed up for you: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4f13c93497e366cd8e41561a8e30ad4da887cb82
There was a recent request [1] to mark as `#[inline]` the simple
`From::from()` functions implemented for `Error`.
Thus mark all of the existing
impl From<...> for Error {
fn from(err: ...) -> Self {
...
}
}
functions in the `kernel` crate as `#[inline]`.
Suggested-by: Gary Guo <gary@garyguo.net>
Link: https://lore.kernel.org/all/8403c8b7a832b5274743816eb77abfa4@garyguo.net/ [1]
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
7a57164 to
6ca412c
Compare
#[inline] all From::from()s for Error
Author
|
Commit is updated |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There was a recent request [1] to mark as
#[inline]the simpleFrom::from()functions implemented forError.Thus mark all of the existing
functions in the
kernelcrate as#[inline].Suggested-by: Gary Guo gary@garyguo.net
Link: https://lore.kernel.org/all/8403c8b7a832b5274743816eb77abfa4@garyguo.net/ [1]