]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/late-bound-in-borrow-closure-sugg.stderr
Rollup merge of #107477 - GuillaumeGomez:css-var, r=notriddle
[rust.git] / tests / ui / suggestions / late-bound-in-borrow-closure-sugg.stderr
1 error[E0631]: type mismatch in closure arguments
2   --> $DIR/late-bound-in-borrow-closure-sugg.rs:26:24
3    |
4 LL |     let closure = |trader : Trader| {
5    |                   ----------------- found signature defined here
6 ...
7 LL |     trader.set_closure(closure);
8    |            ----------- ^^^^^^^ expected due to this
9    |            |
10    |            required by a bound introduced by this call
11    |
12    = note: expected closure signature `for<'a, 'b> fn(&'a mut Trader<'b>) -> _`
13               found closure signature `for<'a> fn(Trader<'a>) -> _`
14 note: required by a bound in `Trader::<'a>::set_closure`
15   --> $DIR/late-bound-in-borrow-closure-sugg.rs:15:50
16    |
17 LL |     pub fn set_closure(&mut self, function: impl Fn(&mut Trader) + 'a) {
18    |                                                  ^^^^^^^^^^^^^^^ required by this bound in `Trader::<'a>::set_closure`
19 help: consider borrowing the argument
20    |
21 LL |     let closure = |trader : &mut Trader| {
22    |                             ++++
23
24 error: aborting due to previous error
25
26 For more information about this error, try `rustc --explain E0631`.