Skip to content

README code does not compile #24

Description

@betelgeuse

rustix-uring/README.md

Lines 34 to 35 in 359c9cf

fn main() -> io::Result<()> {
let mut ring = IoUring::new(8)?;

error[E0277]: `?` couldn't convert the error to `std::io::Error`
 --> src/main.rs:6:35
  |
5 | fn main() -> io::Result<()> {
  |              -------------- expected `std::io::Error` because of this
6 |     let mut ring = IoUring::new(8)?;
  |                    ---------------^ the trait `From<Errno>` is not implemented for `std::io::Error`
  |                    |
  |                    this can't be annotated with `?` because it has type `Result<_, Errno>`
  |
  = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
  = help: the following other types implement trait `From<T>`:
            `std::io::Error` implements `From<ErrorKind>`
            `std::io::Error` implements `From<IntoInnerError<W>>`
            `std::io::Error` implements `From<NulError>`
            `std::io::Error` implements `From<TryReserveError>`
            `std::io::Error` implements `From<std::fs::TryLockError>`

ring.submit_and_wait(1)?;

error[E0277]: `?` couldn't convert the error to `std::io::Error`
  --> src/main.rs:23:28
   |
 5 | fn main() -> io::Result<()> {
   |              -------------- expected `std::io::Error` because of this
...
23 |     ring.submit_and_wait(1)?;
   |          ------------------^ the trait `From<Errno>` is not implemented for `std::io::Error`
   |          |
   |          this can't be annotated with `?` because it has type `Result<_, Errno>`
   |
   = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
   = help: the following other types implement trait `From<T>`:
             `std::io::Error` implements `From<ErrorKind>`
             `std::io::Error` implements `From<IntoInnerError<W>>`
             `std::io::Error` implements `From<NulError>`
             `std::io::Error` implements `From<TryReserveError>`
             `std::io::Error` implements `From<std::fs::TryLockError>`

For more information about this error, try `rustc --explain E0277`.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions