]> git.proxmox.com Git - rustc.git/blame - src/test/ui/impl-trait/hidden-lifetimes.stderr
New upstream version 1.64.0+dfsg1
[rustc.git] / src / test / ui / impl-trait / hidden-lifetimes.stderr
CommitLineData
064997fb 1error[E0700]: hidden type for `impl Swap` captures lifetime that does not appear in bounds
5e7ed085 2 --> $DIR/hidden-lifetimes.rs:29:5
dc9dc135
XL
3 |
4LL | fn hide_ref<'a, 'b, T: 'static>(x: &'a mut &'b T) -> impl Swap + 'a {
5e7ed085
FG
5 | -- hidden type `&'a mut &'b T` captures the lifetime `'b` as defined here
6LL | x
7 | ^
dc9dc135 8 |
a2a8927a 9help: to declare that the `impl Trait` captures `'b`, you can add an explicit `'b` lifetime bound
dc9dc135 10 |
c295e0f8
XL
11LL | fn hide_ref<'a, 'b, T: 'static>(x: &'a mut &'b T) -> impl Swap + 'a + 'b {
12 | ++++
dc9dc135 13
064997fb 14error[E0700]: hidden type for `impl Swap` captures lifetime that does not appear in bounds
5e7ed085 15 --> $DIR/hidden-lifetimes.rs:46:5
dc9dc135
XL
16 |
17LL | fn hide_rc_refcell<'a, 'b: 'a, T: 'static>(x: Rc<RefCell<&'b T>>) -> impl Swap + 'a {
5e7ed085
FG
18 | -- hidden type `Rc<RefCell<&'b T>>` captures the lifetime `'b` as defined here
19LL | x
20 | ^
dc9dc135 21 |
a2a8927a 22help: to declare that the `impl Trait` captures `'b`, you can add an explicit `'b` lifetime bound
dc9dc135 23 |
c295e0f8
XL
24LL | fn hide_rc_refcell<'a, 'b: 'a, T: 'static>(x: Rc<RefCell<&'b T>>) -> impl Swap + 'a + 'b {
25 | ++++
dc9dc135
XL
26
27error: aborting due to 2 previous errors
28
29For more information about this error, try `rustc --explain E0700`.