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
fnmain(){letmut stdin = std::io::stdio::stdin();spawn(proc(){for line in stdin.lines(){print!("{}", line);}});}
Gives this warning:
<anon>:2:9: 2:18 warning: variable does not need to be mutable, #[warn(unused_mut)] on by default
<anon>:2 let mut stdin = std::io::stdio::stdin();
^~~~~~~~~
However, removing the mut is an error:
<anon>:4:21: 4:26 error: cannot borrow immutable captured outer variable in a proc `stdin` as mutable
<anon>:4 for line in stdin.lines() {
^~~~~
error: aborting due to previous error
The text was updated successfully, but these errors were encountered:
This example:
Gives this warning:
However, removing the
mut
is an error:The text was updated successfully, but these errors were encountered: