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
Following code passes borrow checking leading to serious memory unsafety.
fnmain(){letmut v = Vec::new();for _ in v.iter(){
v.push('j');}}
Code compiles with &c instead of _ too. Loop fails to compile only in for c in v.iter() case where there's an explicit variable with reference or when the loop is desugared manually.
The text was updated successfully, but these errors were encountered:
Following code passes borrow checking leading to serious memory unsafety.
Code compiles with
&c
instead of_
too. Loop fails to compile only infor c in v.iter()
case where there's an explicit variable with reference or when the loop is desugared manually.The text was updated successfully, but these errors were encountered: