You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A pipeline over a List or slice does not iterate it, and a slice has no iter() #2534
rest |> filter(it < pivot): error: undefined variable at it. A pipeline over a List/slice value is not an iterator, so the stage does not see a sequence and it is never bound.
rest.iter() |> filter(it < pivot): error: unknown method 'iter' for type '[]isize'. The rest pattern binds a slice, and a slice has no iter() (a List does, as the ListIter view).
Expected: a pipeline whose left side is a sequence (a List, a slice, an array) iterates it, the same .iter() the for loop inserts; and a slice has an iter() yielding &T, the same view iterator List has. Nothing here is a choice the programmer could spell differently, so the compiler writes it (mission: when one meaning is forced, With infers). The for x in rest loop form compiles today, so this is the pipeline and slice surface only.
Needs the §18 pipeline words to say a sequence on the left is iterated; the non-generic quicksort above becomes the fixture.
Activity
D142 and D143: a pipeline iterates a sequence, a slice has iter(), a …