E.g. in regular closures you can often add `move` to change semantic meaning: foo(|x| x * x); // borrows foo(move |x| x * x); // takes ownership But `async` would never be optional: foo(async |x| x * x); foo(|x| x * x); // compile error So why not infer?
-
-
Show this thread
-
In a way this is how blocks already behave; they already apply inference: async fn foo() { { /* this block supports .await */ } } Which is different from "async blocks" which are a construct to create a *new* future (value). Does that make sense?
Show this thread -
Usual disclosure: I'm not on the lang team, nor am I a language designer so please interpret this accordingly (:
Show this thread
End of conversation
New conversation -
-
-
Perhaps clarity? From looking at a foo(|x| ...) I wouldn’t know whether it is or isn’t asynchronous anymore
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.