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
use std::util;
fn main() {
let mut x = ();
util::ignore((&mut x, util::ignore(&mut x)));
}
The error is "can't borrow x as mutable more than once at a time", even though a trivial rewrite of the program would show that the first borrow doesn't live until the second function call is made.
In case this looks too contrived, the actual code I was writing when I ran into this was:
Add `format_in_format_args` and `to_string_in_format_args` lints
Fixesrust-lang#7667 and rust-lang#7729
I put these in `perf` since that was one of `@jplatte's` suggestions, and `redundant_clone` (which I consider to be similar) lives there as well.
However, I am open to changing the category or anything else.
r? `@camsteffen`
changelog: Add `format_in_format_args` and `to_string_in_format_args` lints
Example program:
The error is "can't borrow x as mutable more than once at a time", even though a trivial rewrite of the program would show that the first borrow doesn't live until the second function call is made.
In case this looks too contrived, the actual code I was writing when I ran into this was:
The text was updated successfully, but these errors were encountered: