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
Currently with crossbeam 0.8.2 using select! with rust-analyzer (and rustfmt) is quite annoying because rustfmt cannot format the inner contents and rust-analyzer cannot give much or any auto-completion (especially on incomplete input like msg.).
Workarounds would be to use functions instead of a macro, but in my opinion using Select directly currently is somewhat unsafe / a maintenance problem, because indexes out-of-bounds could be used or the order of events might be change and with that the returned index but the match block might be forgotten to be changed and so lead to a panic (assert on pointers).
Something to fix this would be something akin to sel.recv(&rx1, SomeEnum::rx1)(where either the enum is a u* or Hash?) and later matching against that enum (in case it is already defined a panic should be used) or directly (if possible) store the receiver and return it with the SelectedOperation
The text was updated successfully, but these errors were encountered:
Currently with crossbeam
0.8.2
usingselect!
with rust-analyzer (and rustfmt) is quite annoying becauserustfmt
cannot format the inner contents andrust-analyzer
cannot give much or any auto-completion (especially on incomplete input likemsg.
).Full Repository
rust-lang/rust-analyzer#12759
Workarounds would be to use functions instead of a macro, but in my opinion using
Select
directly currently is somewhat unsafe / a maintenance problem, because indexes out-of-bounds could be used or the order of events might be change and with that the returned index but the match block might be forgotten to be changed and so lead to a panic (assert on pointers).Something to fix this would be something akin to
sel.recv(&rx1, SomeEnum::rx1)
(where either the enum is au*
orHash
?) and later matching against that enum (in case it is already defined a panic should be used) or directly (if possible) store the receiver and return it with theSelectedOperation
The text was updated successfully, but these errors were encountered: