Closed
Description
(Follow up to #60635 and #60641)
When trying to match on the result of a fn
call, we emit:
error[E0164]: expected tuple struct/variant, found method `<A>::new`
--> src/lib.rs:15:9
|
15 | A::new() => (),
| ^^^^^^^^ not a tuple variant or struct
We should explain that fn
calls are not allowed ever in patterns, only refutable (or even irrefutable, as you can match on a struct, although it is silly) types, possibly linking to (or cribbing text from) the appropriate chapter in The Book.