fork/rust

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

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

master
2.8 KiB79 linesraw
1error[E0308]: mismatched types
2  --> $DIR/missing-universe-cause-issue-114907.rs:33:5
3   |
4LL |     accept(callback);
5   |     ^^^^^^^^^^^^^^^^ one type is more general than the other
6   |
7   = note: expected trait `for<'a> FnOnce<(&'a (),)>`
8              found trait `FnOnce<(&(),)>`
9note: this closure does not fulfill the lifetime requirements
10  --> $DIR/missing-universe-cause-issue-114907.rs:32:20
11   |
12LL |     let callback = |_| {};
13   |                    ^^^
14note: the lifetime requirement is introduced here
15  --> $DIR/missing-universe-cause-issue-114907.rs:27:14
16   |
17LL | fn accept<C: FnOnce(&())>(_: C) -> Handshake<HandshakeCallback<C>> {
18   |              ^^^^^^^^^^^
19help: consider specifying the type of the closure parameters
20   |
21LL |     let callback = |_: &_| {};
22   |                    ~~~~~~~
23
24error: implementation of `FnOnce` is not general enough
25  --> $DIR/missing-universe-cause-issue-114907.rs:33:5
26   |
27LL |     accept(callback);
28   |     ^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough
29   |
30   = note: closure with signature `fn(&'2 ())` must implement `FnOnce<(&'1 (),)>`, for any lifetime `'1`...
31   = note: ...but it actually implements `FnOnce<(&'2 (),)>`, for some specific lifetime `'2`
32
33error: implementation of `FnOnce` is not general enough
34  --> $DIR/missing-universe-cause-issue-114907.rs:33:5
35   |
36LL |     accept(callback);
37   |     ^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough
38   |
39   = note: closure with signature `fn(&'2 ())` must implement `FnOnce<(&'1 (),)>`, for any lifetime `'1`...
40   = note: ...but it actually implements `FnOnce<(&'2 (),)>`, for some specific lifetime `'2`
41
42error[E0308]: mismatched types
43  --> $DIR/missing-universe-cause-issue-114907.rs:33:5
44   |
45LL |     accept(callback);
46   |     ^^^^^^^^^^^^^^^^ one type is more general than the other
47   |
48   = note: expected trait `for<'a> FnOnce<(&'a (),)>`
49              found trait `FnOnce<(&(),)>`
50note: this closure does not fulfill the lifetime requirements
51  --> $DIR/missing-universe-cause-issue-114907.rs:32:20
52   |
53LL |     let callback = |_| {};
54   |                    ^^^
55note: the lifetime requirement is introduced here
56  --> $DIR/missing-universe-cause-issue-114907.rs:20:21
57   |
58LL | struct Handshake<R: Role> {
59   |                     ^^^^
60help: consider specifying the type of the closure parameters
61   |
62LL |     let callback = |_: &_| {};
63   |                    ~~~~~~~
64
65error: higher-ranked subtype error
66  --> $DIR/missing-universe-cause-issue-114907.rs:33:21
67   |
68LL |     accept(callback);
69   |                     ^
70
71error: higher-ranked subtype error
72  --> $DIR/missing-universe-cause-issue-114907.rs:33:21
73   |
74LL |     accept(callback);
75   |                     ^
76
77error: aborting due to 6 previous errors
78
79For more information about this error, try `rustc --explain E0308`.