]> git.lizzy.rs Git - rust.git/blob - tests/ui/higher-rank-trait-bounds/hrtb-malformed-lifetime-generics.stderr
Rollup merge of #106805 - madsravn:master, r=compiler-errors
[rust.git] / tests / ui / higher-rank-trait-bounds / hrtb-malformed-lifetime-generics.stderr
1 error: `Fn` traits cannot take lifetime parameters
2   --> $DIR/hrtb-malformed-lifetime-generics.rs:4:17
3    |
4 LL | fn fa(_: impl Fn<'a>(&'a str) -> bool) {}
5    |                 ^^^^
6    |
7 help: consider using a higher-ranked trait bound instead
8    |
9 LL - fn fa(_: impl Fn<'a>(&'a str) -> bool) {}
10 LL + fn fa(_: impl for<'a> Fn(&'a str) -> bool) {}
11    |
12
13 error: `Fn` traits cannot take lifetime parameters
14   --> $DIR/hrtb-malformed-lifetime-generics.rs:7:20
15    |
16 LL | fn fb(_: impl FnMut<'a, 'b>(&'a str, &'b str) -> bool) {}
17    |                    ^^^^^^^^
18    |
19 help: consider using a higher-ranked trait bound instead
20    |
21 LL - fn fb(_: impl FnMut<'a, 'b>(&'a str, &'b str) -> bool) {}
22 LL + fn fb(_: impl for<'a, 'b> FnMut(&'a str, &'b str) -> bool) {}
23    |
24
25 error: `Fn` traits cannot take lifetime parameters
26   --> $DIR/hrtb-malformed-lifetime-generics.rs:10:41
27    |
28 LL | fn fc(_: impl std::fmt::Display + FnOnce<'a>(&'a str) -> bool + std::fmt::Debug) {}
29    |                                         ^^^^
30    |
31 help: consider using a higher-ranked trait bound instead
32    |
33 LL - fn fc(_: impl std::fmt::Display + FnOnce<'a>(&'a str) -> bool + std::fmt::Debug) {}
34 LL + fn fc(_: impl std::fmt::Display + for<'a> FnOnce(&'a str) -> bool + std::fmt::Debug) {}
35    |
36
37 error: `Fn` traits cannot take lifetime parameters
38   --> $DIR/hrtb-malformed-lifetime-generics.rs:14:24
39    |
40 LL | fn fd(_: impl AliasedFn<'a>(&'a str) -> bool) {}
41    |                        ^^^^
42    |
43 help: consider using a higher-ranked trait bound instead
44    |
45 LL - fn fd(_: impl AliasedFn<'a>(&'a str) -> bool) {}
46 LL + fn fd(_: impl for<'a> AliasedFn(&'a str) -> bool) {}
47    |
48
49 error: `Fn` traits cannot take lifetime parameters
50   --> $DIR/hrtb-malformed-lifetime-generics.rs:17:27
51    |
52 LL | fn fe<F>(_: F) where F: Fn<'a>(&'a str) -> bool {}
53    |                           ^^^^
54    |
55 help: consider using a higher-ranked trait bound instead
56    |
57 LL - fn fe<F>(_: F) where F: Fn<'a>(&'a str) -> bool {}
58 LL + fn fe<F>(_: F) where F: for<'a> Fn(&'a str) -> bool {}
59    |
60
61 error: aborting due to 5 previous errors
62