Skip to content

Enabling feature(effects) causes const_patterns_without_partial_eq to show up #121076

Closed
@RalfJung

Description

@RalfJung

The following code works fine without the effects feature, but triggers a warning (soon to become a hard error) when the feature is enabled:

#![feature(effects)]
#[derive(Eq, PartialEq)]
pub struct TypeThatIsPartialEq(u8);
pub const GREEN: TypeThatIsPartialEq = TypeThatIsPartialEq(4);

pub const fn is_green(x: TypeThatIsPartialEq) -> bool {
    match x { GREEN => true, _ => false }
}

Playground

Metadata

Metadata

Assignees

No one assigned

    Labels

    F-effects`#![feature(effects)]`requires-nightlyThis issue requires a nightly compiler in some way.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions