Skip to main content

self_operator_method

Function self_operator_method 

Source
pub fn self_operator_method(expr: &Expr) -> Option<&'static str>
Expand description

The operator method this node reaches on the body’s own receiver, for a node whose receiver is self.

A method that applies its own operator to self calls itself, and the recursion check works off the names a body calls; without this a method like fn +(self, o) returning self + o under a guard is inlined into itself forever. The derived forms swap or negate, so > looks at the right operand and != at the left.