Open
Description
(moved (again) from rust-lang/rust#79405)
With the following code:
fn f(vec: &Vec<usize>) {
vec.push(5);
}
I get a suggestion to "change this to a mutable reference", but if I do, I get:
fn f(vec: &mut std::vec::Vec<usize>) {
vec.push(5);
}
That's a bit overkill, right? I would rather expect
fn f(vec: &mut Vec<usize>) {
vec.push(5);
}
It actually becomes worse. I've decided to file this bug report after my argument:
shells: &LocatedShells,
was changed to
shells: &mut topology::located_slice::LocatedBoxedSlice<std::collections::HashMap<usize, shell::Shell, std::hash::BuildHasherDefault<fnv::FnvHasher>>>,
instead of just
shells: &mut LocatedShells,
That's definitely overkill, so I end up changing the &
to &mut
by hand.
Is this something expected? Or something I can configure not to happen?