fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.6 KiB33 linesraw
1error[E0700]: hidden type for `impl Swap + 'a` captures lifetime that does not appear in bounds
2  --> $DIR/hidden-lifetimes.rs:29:5
3   |
4LL | fn hide_ref<'a, 'b, T: 'static>(x: &'a mut &'b T) -> impl Swap + 'a {
5   |                 --                                   -------------- opaque type defined here
6   |                 |
7   |                 hidden type `&'a mut &'b T` captures the lifetime `'b` as defined here
8LL |     x
9   |     ^
10   |
11help: to declare that `impl Swap + 'a` captures `'b`, you can add an explicit `'b` lifetime bound
12   |
13LL | fn hide_ref<'a, 'b, T: 'static>(x: &'a mut &'b T) -> impl Swap + 'a + 'b {
14   |                                                                     ++++
15
16error[E0700]: hidden type for `impl Swap + 'a` captures lifetime that does not appear in bounds
17  --> $DIR/hidden-lifetimes.rs:46:5
18   |
19LL | fn hide_rc_refcell<'a, 'b: 'a, T: 'static>(x: Rc<RefCell<&'b T>>) -> impl Swap + 'a {
20   |                        --                                            -------------- opaque type defined here
21   |                        |
22   |                        hidden type `Rc<RefCell<&'b T>>` captures the lifetime `'b` as defined here
23LL |     x
24   |     ^
25   |
26help: to declare that `impl Swap + 'a` captures `'b`, you can add an explicit `'b` lifetime bound
27   |
28LL | fn hide_rc_refcell<'a, 'b: 'a, T: 'static>(x: Rc<RefCell<&'b T>>) -> impl Swap + 'a + 'b {
29   |                                                                                     ++++
30
31error: aborting due to 2 previous errors
32
33For more information about this error, try `rustc --explain E0700`.