1 error[E0308]: mismatched types
2 --> $DIR/issue-82612-return-mutable-reference.rs:18:13
4 LL | / if index < self.values.len() {
5 LL | | let value = unsafe { self.values.get_unchecked_mut(index) };
6 LL | | value.get_or_insert_with(func)
7 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `&mut V`
9 | |_________- expected this to be `()`
11 = note: expected unit type `()`
12 found mutable reference `&mut V`
13 help: consider using a semicolon here
15 LL | value.get_or_insert_with(func);
17 help: consider using a semicolon here
21 help: you might have meant to return this value
23 LL | return value.get_or_insert_with(func);
26 error: aborting due to previous error
28 For more information about this error, try `rustc --explain E0308`.