Pattern guard problem replacing FP literal pattern #42663
Labels
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
I-needs-decision
Issue: In need of a decision.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
T-lang
Relevant to the language team, which will review and decide on the PR/issue.
This is an Rust language ergonomy problem regarding pattern matching that contains floating point values.
This is a reduction of code that was OK:
Those FP patterns will go away, so I've tried to replace them like this:
But I get errors:
The pattern guard is "if z == 0.0" it uses just z and a FP contanst, it doesn't touch the x value.
I'd like ergonomy improvements to solve this problem in some nice way at language level (or Prelude level).
See also the short thread:
https://users.rust-lang.org/t/pattern-guard-problem-replacing-fp-literal-pattern/11207
The text was updated successfully, but these errors were encountered: