Skip to main content

desugared_set_method

Function desugared_set_method 

Source
pub fn desugared_set_method<'a>(
    call_node: &'a AIRNode,
    callee: &'a AIRNode,
    args: &'a [AirArg],
) -> Option<(&'a AIRNode, &'a str, &'a [AirArg])>
Expand description

Recognise a desugared Set[E] built-in method call.

The Set counterpart of desugared_map_method: requires the recv_kind = "Set" annotation and a method in SET_METHODS. Returns the receiver node, the method name, and the remaining (non-self) arguments. The recv_kind disambiguation is what lets a backend distinguish s.contains(x) on a Set (native membership) from the same call on a List (a linear scan), and s.len()/s.filter(..)/s.map(..) from their List forms.