fork/rust

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

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

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