Skip to content

regression: cant compare str with &str #130575

Closed
@BoxyUwU

Description

@BoxyUwU
[INFO] [stdout] error[E0277]: can't compare `str` with `&str`
[INFO] [stdout]   --> src/lib.rs:29:40
[INFO] [stdout]    |
[INFO] [stdout] 29 |         assert!(input.is_none_or(|x| x == &"test"));
[INFO] [stdout]    |                                        ^^ no implementation for `str == &str`
[INFO] [stdout]    |
[INFO] [stdout]    = help: the trait `PartialEq<&str>` is not implemented for `str`, which is required by `&str: PartialEq<&&str>`
[INFO] [stdout]    = note: required for `&str` to implement `PartialEq<&&str>

I think this was caused by stabilizing is_none_or?

note: if this breakage was accepted by the relevant team then this issue can be closed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-libsRelevant to the library team, which will review and decide on the PR/issue.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions