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
pubfncapture_assign_whole(x:(i32,)){
|| { x = (1,);};}fnmain(){capture_assign_whole((1000,));}
Under both AST-borrowck and #![feature(nll)], it errors.
But under NLL migration mode (the default for the 2018 edition), it downgrades the error to a warning.
My current hypothesis (which has been supported by inspecting RUST_LOG output) is that after the migrate mode encounters the NLL error, when it runs the AST-borrowck to see if it also errors, it runs the borrowck only on the closure body, not the parent, which means it misses the mutable borrow that occurs when the mutable capture occurs in the parent for an immutable binding x.