]> Gentwo Git Trees - linux/.git/commit
rust: pin-init: examples: error: use `Error` in `fn main()`
authorBenno Lossin <lossin@kernel.org>
Mon, 18 Aug 2025 13:18:44 +0000 (15:18 +0200)
committerBenno Lossin <lossin@kernel.org>
Thu, 11 Sep 2025 21:25:54 +0000 (23:25 +0200)
commit3d536277449e4de4609d4f0b8302ae7fd00b04b2
treef4a911054c99cff87709c5ed0ae5d17bce2235b4
parent8f5ae30d69d7543eee0d70083daf4de8fe15d585
rust: pin-init: examples: error: use `Error` in `fn main()`

When running this example with no cargo features enabled, the compiler
warns on 1.89:

  error: struct `Error` is never constructed
    --> examples/error.rs:11:12
     |
  11 | pub struct Error;
     |            ^^^^^
     |
     = note: `-D dead-code` implied by `-D warnings`
     = help: to override `-D warnings` add `#[allow(dead_code)]`

Thus use the error in the main function to avoid this warning.

Signed-off-by: Benno Lossin <lossin@kernel.org>
rust/pin-init/examples/error.rs