Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
RalfJung opened this issue Feb 14, 2024 · 4 comments
Closed
Labels
F-effects `#![feature(effects)]` requires-nightly This issue requires a nightly compiler in some way.

Comments

@RalfJung
Copy link
Member

RalfJung commented Feb 14, 2024

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

@RalfJung RalfJung added the F-effects `#![feature(effects)]` label Feb 14, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 14, 2024
@RalfJung RalfJung added the requires-nightly This issue requires a nightly compiler in some way. label Feb 14, 2024
@bend-n
Copy link
Contributor

bend-n commented Feb 14, 2024

i think this is a duplicate of #119398

@RalfJung
Copy link
Member Author

Ah, true. Why didn't you mention on Zulip that you had filed an issue?^^ Would have saved me some work...

@bend-n
Copy link
Contributor

bend-n commented Feb 14, 2024

Ah, true. Why didn't you mention on Zulip that you had filed an issue?^^ Would have saved me some work...

i created the issue as a request on the zulip thread https://rust-lang.zulipchat.com/#narrow/stream/146212-t-compiler.2Fconst-eval/topic/match.20on.20const.20triggers.20warning.20with.20effects/near/410360676

@RalfJung
Copy link
Member Author

RalfJung commented Feb 14, 2024

Ah, I must have forgotten about that. Sorry :)

@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-effects `#![feature(effects)]` requires-nightly This issue requires a nightly compiler in some way.
Projects
None yet
Development

No branches or pull requests

4 participants