fork/rust

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

borsAuto merge of #68568 - pietroalbini:stable-next, r=pietroalbini5e1a799842b

1.41.0
2.5 KiB79 linesraw
1warning: function cannot return without recursing
2  --> $DIR/hrtb-perfect-forwarding.rs:22:1
3   |
4LL | / fn no_hrtb<'b,T>(mut t: T)
5LL | |     where T : Bar<&'b isize>
6LL | | {
7LL | |     // OK -- `T : Bar<&'b isize>`, and thus the impl above ensures that
8LL | |     // `&mut T : Bar<&'b isize>`.
9LL | |     no_hrtb(&mut t);
10   | |     --------------- recursive call site
11LL | | }
12   | |_^ cannot return without recursing
13   |
14   = note: `#[warn(unconditional_recursion)]` on by default
15   = help: a `loop` may express intention better if this is on purpose
16
17warning: function cannot return without recursing
18  --> $DIR/hrtb-perfect-forwarding.rs:30:1
19   |
20LL | / fn bar_hrtb<T>(mut t: T)
21LL | |     where T : for<'b> Bar<&'b isize>
22LL | | {
23LL | |     // OK -- `T : for<'b> Bar<&'b isize>`, and thus the impl above
24...  |
25LL | |     bar_hrtb(&mut t);
26   | |     ---------------- recursive call site
27LL | | }
28   | |_^ cannot return without recursing
29   |
30   = help: a `loop` may express intention better if this is on purpose
31
32warning: function cannot return without recursing
33  --> $DIR/hrtb-perfect-forwarding.rs:39:1
34   |
35LL | / fn foo_hrtb_bar_not<'b,T>(mut t: T)
36LL | |     where T : for<'a> Foo<&'a isize> + Bar<&'b isize>
37LL | | {
38LL | |     // Not OK -- The forwarding impl for `Foo` requires that `Bar` also
39...  |
40LL | |     foo_hrtb_bar_not(&mut t);
41   | |     ------------------------ recursive call site
42LL | | }
43   | |_^ cannot return without recursing
44   |
45   = help: a `loop` may express intention better if this is on purpose
46
47error: higher-ranked subtype error
48  --> $DIR/hrtb-perfect-forwarding.rs:46:5
49   |
50LL |     foo_hrtb_bar_not(&mut t);
51   |     ^^^^^^^^^^^^^^^^^^^^^^^^
52
53error: lifetime may not live long enough
54  --> $DIR/hrtb-perfect-forwarding.rs:46:5
55   |
56LL | fn foo_hrtb_bar_not<'b,T>(mut t: T)
57   |                     -- lifetime `'b` defined here
58...
59LL |     foo_hrtb_bar_not(&mut t);
60   |     ^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'b` must outlive `'static`
61   |
62   = help: consider replacing `'b` with `'static`
63
64warning: function cannot return without recursing
65  --> $DIR/hrtb-perfect-forwarding.rs:49:1
66   |
67LL | / fn foo_hrtb_bar_hrtb<T>(mut t: T)
68LL | |     where T : for<'a> Foo<&'a isize> + for<'b> Bar<&'b isize>
69LL | | {
70LL | |     // OK -- now we have `T : for<'b> Bar&'b isize>`.
71LL | |     foo_hrtb_bar_hrtb(&mut t);
72   | |     ------------------------- recursive call site
73LL | | }
74   | |_^ cannot return without recursing
75   |
76   = help: a `loop` may express intention better if this is on purpose
77
78error: aborting due to 2 previous errors
79