]> git.proxmox.com Git - rustc.git/blame - src/test/ui/higher-rank-trait-bounds/hrtb-perfect-forwarding.stderr
New upstream version 1.66.0+dfsg1
[rustc.git] / src / test / ui / higher-rank-trait-bounds / hrtb-perfect-forwarding.stderr
CommitLineData
923072b8
FG
1warning: function cannot return without recursing
2 --> $DIR/hrtb-perfect-forwarding.rs:16:1
3 |
4LL | / fn no_hrtb<'b, T>(mut t: T)
5LL | | where
6LL | | T: Bar<&'b isize>,
064997fb
FG
7 | |______________________^ cannot return without recursing
8...
9LL | no_hrtb(&mut t);
10 | --------------- recursive call site
923072b8 11 |
923072b8 12 = help: a `loop` may express intention better if this is on purpose
2b03887a 13 = note: `#[warn(unconditional_recursion)]` on by default
923072b8
FG
14
15warning: function cannot return without recursing
16 --> $DIR/hrtb-perfect-forwarding.rs:25:1
17 |
18LL | / fn bar_hrtb<T>(mut t: T)
19LL | | where
20LL | | T: for<'b> Bar<&'b isize>,
064997fb
FG
21 | |______________________________^ cannot return without recursing
22...
23LL | bar_hrtb(&mut t);
24 | ---------------- recursive call site
923072b8
FG
25 |
26 = help: a `loop` may express intention better if this is on purpose
27
28warning: function cannot return without recursing
29 --> $DIR/hrtb-perfect-forwarding.rs:35:1
30 |
31LL | / fn foo_hrtb_bar_not<'b, T>(mut t: T)
32LL | | where
33LL | | T: for<'a> Foo<&'a isize> + Bar<&'b isize>,
064997fb
FG
34 | |_______________________________________________^ cannot return without recursing
35...
36LL | foo_hrtb_bar_not(&mut t);
37 | ------------------------ recursive call site
923072b8
FG
38 |
39 = help: a `loop` may express intention better if this is on purpose
40
41error: lifetime may not live long enough
6a06907d 42 --> $DIR/hrtb-perfect-forwarding.rs:43:5
b7449926 43 |
923072b8
FG
44LL | fn foo_hrtb_bar_not<'b, T>(mut t: T)
45 | -- lifetime `'b` defined here
46...
532ac7d7 47LL | foo_hrtb_bar_not(&mut t);
923072b8 48 | ^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'b` must outlive `'static`
f2b60f7d
FG
49 |
50note: due to current limitations in the borrow checker, this implies a `'static` lifetime
51 --> $DIR/hrtb-perfect-forwarding.rs:37:8
52 |
53LL | T: for<'a> Foo<&'a isize> + Bar<&'b isize>,
54 | ^^^^^^^^^^^^^^^^^^^^^^
b7449926 55
6a06907d
XL
56error: implementation of `Bar` is not general enough
57 --> $DIR/hrtb-perfect-forwarding.rs:43:5
dfeec247
XL
58 |
59LL | foo_hrtb_bar_not(&mut t);
923072b8 60 | ^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Bar` is not general enough
5869c6ff 61 |
6a06907d 62 = note: `T` must implement `Bar<&'0 isize>`, for any lifetime `'0`...
923072b8
FG
63 = note: ...but it actually implements `Bar<&'1 isize>`, for some specific lifetime `'1`
64
65warning: function cannot return without recursing
66 --> $DIR/hrtb-perfect-forwarding.rs:48:1
67 |
68LL | / fn foo_hrtb_bar_hrtb<T>(mut t: T)
69LL | | where
70LL | | T: for<'a> Foo<&'a isize> + for<'b> Bar<&'b isize>,
064997fb
FG
71 | |_______________________________________________________^ cannot return without recursing
72...
73LL | foo_hrtb_bar_hrtb(&mut t);
74 | ------------------------- recursive call site
923072b8
FG
75 |
76 = help: a `loop` may express intention better if this is on purpose
dfeec247 77
923072b8 78error: aborting due to 2 previous errors; 4 warnings emitted
b7449926 79