linux/rust/kernel
Alice Ryhl 4a59081c09 rust: error: allow specifying error type on Result
Currently, if the `kernel::error::Result` type is in scope (which is
often is, since it's in the kernel's prelude), you cannot write
`Result<T, SomeOtherErrorType>` when you want to use a different error
type than `kernel::error::Error`.

To solve this we change the error type from being hard-coded to just
being a default generic parameter. This still lets you write `Result<T>`
when you just want to use the `Error` error type, but also lets you
write `Result<T, SomeOtherErrorType>` when necessary.

Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Reviewed-by: Asahi Lina <lina@asahilina.net>
Reviewed-by: Andreas Hindborg <a.hindborg@samsung.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Link: https://lore.kernel.org/r/20230502124015.356001-1-aliceryhl@google.com
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2023-05-31 18:53:10 +02:00
..
init rust: init: update macro expansion example in docs 2023-05-31 18:53:10 +02:00
sync rust: arc: fix intra-doc link in Arc<T>::init 2023-05-31 16:12:06 +02:00
allocator.rs
build_assert.rs rust: upgrade to Rust 1.68.2 2023-05-31 17:35:03 +02:00
error.rs rust: error: allow specifying error type on Result 2023-05-31 18:53:10 +02:00
init.rs rust: upgrade to Rust 1.68.2 2023-05-31 17:35:03 +02:00
ioctl.rs rust: ioctl: Add ioctl number manipulation functions 2023-04-22 01:46:45 +02:00
lib.rs rust: upgrade to Rust 1.68.2 2023-05-31 17:35:03 +02:00
prelude.rs rust: introduce current 2023-04-22 00:20:00 +02:00
print.rs rust: kernel: Mark rust_fmt_argument as extern "C" 2023-04-06 23:11:04 +02:00
static_assert.rs rust: static_assert: add static_assert! macro 2022-12-04 01:59:16 +01:00
std_vendor.rs rust: upgrade to Rust 1.68.2 2023-05-31 17:35:03 +02:00
str.rs rust: str: fix requierments->requirements typo 2023-04-06 21:55:12 +02:00
sync.rs rust: sync: introduce CondVar 2023-04-22 01:46:45 +02:00
task.rs rust: introduce current 2023-04-22 00:20:00 +02:00
types.rs rust: introduce ARef 2023-04-22 00:20:00 +02:00