|
| 1 | +error[E0053]: method `values` has an incompatible type for trait |
| 2 | + --> $DIR/mismatched-map-under-self.rs:10:15 |
| 3 | + | |
| 4 | +LL | fn values(self) -> Self::Values { |
| 5 | + | ^^^^ |
| 6 | + | | |
| 7 | + | expected `&Option<T>`, found `Option<T>` |
| 8 | + | help: change the self-receiver type to match the trait: `&self` |
| 9 | + | |
| 10 | +note: type in trait |
| 11 | + --> $DIR/mismatched-map-under-self.rs:4:15 |
| 12 | + | |
| 13 | +LL | fn values(&self) -> Self::Values; |
| 14 | + | ^^^^^ |
| 15 | + = note: expected signature `fn(&Option<T>)` |
| 16 | + found signature `fn(Option<T>)` |
| 17 | + |
| 18 | +error[E0631]: type mismatch in function arguments |
| 19 | + --> $DIR/mismatched-map-under-self.rs:12:18 |
| 20 | + | |
| 21 | +LL | fn values(&self) -> Self::Values; |
| 22 | + | --------------------------------- found signature defined here |
| 23 | +... |
| 24 | +LL | self.map(Insertable::values).unwrap_or_default() |
| 25 | + | --- ^^^^^^^^^^^^^^^^^^ expected due to this |
| 26 | + | | |
| 27 | + | required by a bound introduced by this call |
| 28 | + | |
| 29 | + = note: expected function signature `fn(T) -> _` |
| 30 | + found function signature `for<'a> fn(&'a _) -> _` |
| 31 | +note: required by a bound in `Option::<T>::map` |
| 32 | + --> $SRC_DIR/core/src/option.rs:LL:COL |
| 33 | +help: consider adjusting the signature so it does not borrow its argument |
| 34 | + | |
| 35 | +LL - fn values(&self) -> Self::Values; |
| 36 | +LL + fn values(self) -> Self::Values; |
| 37 | + | |
| 38 | + |
| 39 | +error: aborting due to 2 previous errors |
| 40 | + |
| 41 | +Some errors have detailed explanations: E0053, E0631. |
| 42 | +For more information about an error, try `rustc --explain E0053`. |
0 commit comments