1
1
warning: function cannot return without recursing
2
- --> $DIR/hrtb-perfect-forwarding.rs:22 :1
2
+ --> $DIR/hrtb-perfect-forwarding.rs:16 :1
3
3
|
4
- LL | / fn no_hrtb<'b,T>(mut t: T)
5
- LL | | where T : Bar<&'b isize>
4
+ LL | / fn no_hrtb<'b, T>(mut t: T)
5
+ LL | | where
6
+ LL | | T: Bar<&'b isize>,
6
7
LL | | {
7
- LL | | // OK -- `T : Bar<&'b isize>`, and thus the impl above ensures that
8
- LL | | // `&mut T : Bar<&'b isize>`.
8
+ ... |
9
9
LL | | no_hrtb(&mut t);
10
10
| | --------------- recursive call site
11
11
LL | | }
@@ -15,12 +15,12 @@ LL | | }
15
15
= help: a `loop` may express intention better if this is on purpose
16
16
17
17
warning: function cannot return without recursing
18
- --> $DIR/hrtb-perfect-forwarding.rs:30 :1
18
+ --> $DIR/hrtb-perfect-forwarding.rs:25 :1
19
19
|
20
20
LL | / fn bar_hrtb<T>(mut t: T)
21
- LL | | where T : for<'b> Bar<&'b isize>
21
+ LL | | where
22
+ LL | | T: for<'b> Bar<&'b isize>,
22
23
LL | | {
23
- LL | | // OK -- `T : for<'b> Bar<&'b isize>`, and thus the impl above
24
24
... |
25
25
LL | | bar_hrtb(&mut t);
26
26
| | ---------------- recursive call site
@@ -30,40 +30,42 @@ LL | | }
30
30
= help: a `loop` may express intention better if this is on purpose
31
31
32
32
warning: function cannot return without recursing
33
- --> $DIR/hrtb-perfect-forwarding.rs:39 :1
33
+ --> $DIR/hrtb-perfect-forwarding.rs:35 :1
34
34
|
35
- LL | / fn foo_hrtb_bar_not<'b,T>(mut t: T)
36
- LL | | where T : for<'a> Foo<&'a isize> + Bar<&'b isize>
35
+ LL | / fn foo_hrtb_bar_not<'b, T>(mut t: T)
36
+ LL | | where
37
+ LL | | T: for<'a> Foo<&'a isize> + Bar<&'b isize>,
37
38
LL | | {
38
- LL | | // Not OK -- The forwarding impl for `Foo` requires that `Bar` also
39
39
... |
40
40
LL | | foo_hrtb_bar_not(&mut t);
41
41
| | ------------------------ recursive call site
42
42
LL | |
43
+ LL | |
43
44
LL | | }
44
45
| |_^ cannot return without recursing
45
46
|
46
47
= help: a `loop` may express intention better if this is on purpose
47
48
48
49
error: higher-ranked subtype error
49
- --> $DIR/hrtb-perfect-forwarding.rs:46 :5
50
+ --> $DIR/hrtb-perfect-forwarding.rs:43 :5
50
51
|
51
52
LL | foo_hrtb_bar_not(&mut t);
52
53
| ^^^^^^^^^^^^^^^^^^^^^^^^
53
54
54
55
warning: function cannot return without recursing
55
- --> $DIR/hrtb-perfect-forwarding.rs:50 :1
56
+ --> $DIR/hrtb-perfect-forwarding.rs:48 :1
56
57
|
57
58
LL | / fn foo_hrtb_bar_hrtb<T>(mut t: T)
58
- LL | | where T : for<'a> Foo<&'a isize> + for<'b> Bar<&'b isize>
59
+ LL | | where
60
+ LL | | T: for<'a> Foo<&'a isize> + for<'b> Bar<&'b isize>,
59
61
LL | | {
60
- LL | | // OK -- now we have `T : for<'b> Bar&'b isize>`.
62
+ LL | | // OK -- now we have `T : for<'b> Bar< &'b isize>`.
61
63
LL | | foo_hrtb_bar_hrtb(&mut t);
62
64
| | ------------------------- recursive call site
63
65
LL | | }
64
66
| |_^ cannot return without recursing
65
67
|
66
68
= help: a `loop` may express intention better if this is on purpose
67
69
68
- error: aborting due to previous error
70
+ error: aborting due to previous error; 4 warnings emitted
69
71
0 commit comments