cannot borrow `*self` as mutable because it is also borrowed as immutable
问题 I want my struct function to call itself under special conditions. It worked when I had a HashMap as one of the fields, but it broke when I changed the HashMap to be a Vec . It doesn't even have to be used, which seems very weird and I can't find any reasonable explanation for this. use std::vec::Vec; use std::collections::HashMap; struct Foo<'a> { bar: Vec<&'a str> //bar: HashMap<&'a str, &'a str> } impl<'a> Foo<'a> { pub fn new() -> Foo<'a> { Foo { bar: Vec::new() } //Foo { bar: HashMap: