I am trying to create global variables but I got multiple compilation errors in the process. First I tried this:
static mut (tx, rx): (mpsc::Sender<bool>, mpsc::Receiver<bool>) = mpsc::channel();
error: expected identifier, found `(`
|
109 | static mut (tx, rx): (mpsc::Sender<bool>, mpsc::Receiver<bool>) = mpsc::channel();
^
|
Then I have tried some other forms but it seems that they always give me a similar error:
thread_local!(static mut (tx, rx): (mpsc::Sender<bool>, mpsc::Receiver<bool>) = mpsc::channel());
error: no rules expected the token `(`
|
109 | thread_local!(static mut (tx, rx): (mpsc::Sender<bool>, mpsc::Receiver<bool>) = mpsc::channel());
^
|
Finally, and in case this helps others to respond, it also happens with this:
static (x, y, z) = (1, 2, 3);
error: expected identifier, found `(`
|
109 | static (x, y, z) = (1, 2, 3);
| ^
Maybe it is some error when creating the tuples from a static declaration, but I'm new to Rust, so I do not know if this is true.
staticdoes not take a pattern