Skip to content

Sled 0.31.0 fails to build on Rust 1.89.0 (now stable) #1529

@udoprog

Description

@udoprog

Trying to build sled 0.31.0 on a new version of Rust (rustc 1.89.0 (29483883e 2025-08-04)) results in the following error:

error[E0308]: `if` and `else` have incompatible types
   --> /home/udoprog/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/sled-0.31.0/src/config.rs:552:20
    |
550 |                let try_lock = if self.read_only {
    |  _____________________________-
551 | |                  file.try_lock_shared()
    | |                  ---------------------- expected because of this
552 | |              } else if cfg!(feature = "testing") {
    | | ____________________^
...   ||
560 | ||                 file.try_lock_exclusive()
561 | ||             };
    | ||             ^
    | ||_____________|
    |  |_____________`if` and `else` have incompatible types
    |                expected `Result<(), TryLockError>`, found `Result<(), Error>`
    |
    = note: expected enum `std::result::Result<_, std::fs::TryLockError>`
               found enum `std::result::Result<_, std::io::Error>`

The root cause it the introduction of similarly named locking methods in std which have an incompatible signature and are being picked in favor of fs2 extensions.

While the recommendation should be to upgrade sled, in my project this particular code path is used for migrating old sled databases to the newest version. So I would personally appreciate considering doing a patch release to address this issue.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions