Skip to content

or_fun_call triggers on const fn #5658

Closed
@mahkoh

Description

@mahkoh
const fn f(v: i32) -> Option<i32> {
    Some(v)
}

fn main() {
    None.or(f(1));  // try this: `or_else(|| f(1))`
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messagesE-mediumCall for participation: Medium difficulty level problem and requires some initial experience.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions