Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit bfadfbb

Browse files
committed
bless hrtb-perfect-forwarding under polonius
Only some simple diagnostic changes happened, and rustfmt-ing.
1 parent 84f24cc commit bfadfbb

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed
Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
warning: function cannot return without recursing
2-
--> $DIR/hrtb-perfect-forwarding.rs:22:1
2+
--> $DIR/hrtb-perfect-forwarding.rs:16:1
33
|
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>,
67
LL | | {
7-
LL | | // OK -- `T : Bar<&'b isize>`, and thus the impl above ensures that
8-
LL | | // `&mut T : Bar<&'b isize>`.
8+
... |
99
LL | | no_hrtb(&mut t);
1010
| | --------------- recursive call site
1111
LL | | }
@@ -15,12 +15,12 @@ LL | | }
1515
= help: a `loop` may express intention better if this is on purpose
1616

1717
warning: function cannot return without recursing
18-
--> $DIR/hrtb-perfect-forwarding.rs:30:1
18+
--> $DIR/hrtb-perfect-forwarding.rs:25:1
1919
|
2020
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>,
2223
LL | | {
23-
LL | | // OK -- `T : for<'b> Bar<&'b isize>`, and thus the impl above
2424
... |
2525
LL | | bar_hrtb(&mut t);
2626
| | ---------------- recursive call site
@@ -30,40 +30,42 @@ LL | | }
3030
= help: a `loop` may express intention better if this is on purpose
3131

3232
warning: function cannot return without recursing
33-
--> $DIR/hrtb-perfect-forwarding.rs:39:1
33+
--> $DIR/hrtb-perfect-forwarding.rs:35:1
3434
|
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>,
3738
LL | | {
38-
LL | | // Not OK -- The forwarding impl for `Foo` requires that `Bar` also
3939
... |
4040
LL | | foo_hrtb_bar_not(&mut t);
4141
| | ------------------------ recursive call site
4242
LL | |
43+
LL | |
4344
LL | | }
4445
| |_^ cannot return without recursing
4546
|
4647
= help: a `loop` may express intention better if this is on purpose
4748

4849
error: higher-ranked subtype error
49-
--> $DIR/hrtb-perfect-forwarding.rs:46:5
50+
--> $DIR/hrtb-perfect-forwarding.rs:43:5
5051
|
5152
LL | foo_hrtb_bar_not(&mut t);
5253
| ^^^^^^^^^^^^^^^^^^^^^^^^
5354

5455
warning: function cannot return without recursing
55-
--> $DIR/hrtb-perfect-forwarding.rs:50:1
56+
--> $DIR/hrtb-perfect-forwarding.rs:48:1
5657
|
5758
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>,
5961
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>`.
6163
LL | | foo_hrtb_bar_hrtb(&mut t);
6264
| | ------------------------- recursive call site
6365
LL | | }
6466
| |_^ cannot return without recursing
6567
|
6668
= help: a `loop` may express intention better if this is on purpose
6769

68-
error: aborting due to previous error
70+
error: aborting due to previous error; 4 warnings emitted
6971

0 commit comments

Comments
 (0)