2014-05-30 5:37 GMT+04:00 Kevin Ballard <[email protected]>:
>
> It shouldn't.
>
> The for-loop desugaring looks like
>
> match &mut st.execute_query() {
>     __i => loop {
>         match __i.next() {
>             None => break,
>             Some(mut __value) => {
>                 let i = __value;
>                 {
>                     // for loop body goes here
>                 }
>             }
>         }
>     }
> }
>
> It's done with a match statement like this specifically to make the &mut 
> binding of the iterator end after the for loop.

Great, didn't know it. Last time I asked (on StackOverflow, I think;
that was some time ago though) there were no `match`. Then from that
code alone it does look like a bug to me. Note that it refers to
`st.set_string("%e%")` and `for` loop ten lines above, that is, the
first one. If mutable borrow of the iterator aren't escaping the loop,
then this error should not appear, right?
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to