Skip to content

(with nightly rust): src/slice/tests/api.rs: error[E0308]: mismatched types #298

@krasimirgg

Description

@krasimirgg

Using a recent rustc 1.91.0-nightly (05f5a58e8 2025-08-19), building the tests fails:

% cargo +nightly test
error[E0308]: mismatched types
  --> src/slice/tests/api.rs:30:10
   |
30 |     assert!(bits.last().unwrap());
   |             ^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `BitRef<'_>`
   |
   = note: expected struct `bool`
                found type `BitRef<'_>`
help: you might have meant to use field `data` whose type is `bool`
   |
30 |     assert!(bits.last().unwrap().data);
   |                                 +++++
help: consider dereferencing to access the inner value using the Deref trait
   |
30 |     assert!(*bits.last().unwrap());
   |             +

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions