]> git.lizzy.rs Git - rust.git/blob - tests/ui/type-alias-impl-trait/imply_bounds_from_bounds_param.stderr
Auto merge of #107328 - matthiaskrgr:rollup-lfqwo0o, r=matthiaskrgr
[rust.git] / tests / ui / type-alias-impl-trait / imply_bounds_from_bounds_param.stderr
1 error[E0700]: hidden type for `impl PlusOne` captures lifetime that does not appear in bounds
2   --> $DIR/imply_bounds_from_bounds_param.rs:24:5
3    |
4 LL | fn test<'a>(y: &'a mut i32) -> impl PlusOne {
5    |         -- hidden type `<&'a mut i32 as Callable>::Output` captures the lifetime `'a` as defined here
6 LL |     <&'a mut i32 as Callable>::call(y)
7    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8    |
9 help: to declare that `impl PlusOne` captures `'a`, you can add an explicit `'a` lifetime bound
10    |
11 LL | fn test<'a>(y: &'a mut i32) -> impl PlusOne + 'a {
12    |                                             ++++
13
14 error: aborting due to previous error
15
16 For more information about this error, try `rustc --explain E0700`.