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
It works fine with Rust 2018, but with 2015 I'm getting:
error[E0499]: cannot borrow `*input` asmutable more than once at a time
--> src/lib.rs:134:17
|
98 | whileletOk(t) = input.next(){
| ----- - first borrow ends here
| |
| first mutable borrow occurs here
...
134 | input.parse_nested_block(|p| {
| ^^^^^ second mutable borrow occurs here
Is it not possible at all on Rust 2015 or I have to change a code somehow?
The difference is most likely non-lexical lifetimes, which rust-lang/rust#59114 (comment) enables in the 2015 edition as well. I think that will be in Rust 1.36.
Without NLL, you need to move the next use of input outside of the lexical scope where the return value of input.next() lives. Something like:
Activity
SimonSapin commentedon May 27, 2019
The difference is most likely non-lexical lifetimes, which rust-lang/rust#59114 (comment) enables in the 2015 edition as well. I think that will be in Rust 1.36.
Without NLL, you need to move the next use of
inputoutside of the lexical scope where the return value ofinput.next()lives. Something like:Yes this is ugly. It’s why we have NLL :)
RazrFalcon commentedon May 27, 2019
Thanks. Looks like it's time to bump 1.18 to 1.32.