summaryrefslogtreecommitdiffstats
path: root/tests/ui/nll/missing-universe-cause-issue-114907.stderr
blob: a616d29c4fea6c8ac4c23b9e2f28609a9cb60316 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
error[E0308]: mismatched types
  --> $DIR/missing-universe-cause-issue-114907.rs:33:5
   |
LL |     accept(callback);
   |     ^^^^^^^^^^^^^^^^ one type is more general than the other
   |
   = note: expected trait `for<'a> FnOnce(&'a ())`
              found trait `FnOnce(&())`
note: this closure does not fulfill the lifetime requirements
  --> $DIR/missing-universe-cause-issue-114907.rs:32:20
   |
LL |     let callback = |_| {};
   |                    ^^^
note: the lifetime requirement is introduced here
  --> $DIR/missing-universe-cause-issue-114907.rs:27:14
   |
LL | fn accept<C: FnOnce(&())>(_: C) -> Handshake<HandshakeCallback<C>> {
   |              ^^^^^^^^^^^
help: consider specifying the type of the closure parameters
   |
LL |     let callback = |_: &_| {};
   |                    ~~~~~~~

error: implementation of `FnOnce` is not general enough
  --> $DIR/missing-universe-cause-issue-114907.rs:33:5
   |
LL |     accept(callback);
   |     ^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough
   |
   = note: closure with signature `fn(&'2 ())` must implement `FnOnce<(&'1 (),)>`, for any lifetime `'1`...
   = note: ...but it actually implements `FnOnce<(&'2 (),)>`, for some specific lifetime `'2`

error: implementation of `FnOnce` is not general enough
  --> $DIR/missing-universe-cause-issue-114907.rs:33:5
   |
LL |     accept(callback);
   |     ^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough
   |
   = note: closure with signature `fn(&'2 ())` must implement `FnOnce<(&'1 (),)>`, for any lifetime `'1`...
   = note: ...but it actually implements `FnOnce<(&'2 (),)>`, for some specific lifetime `'2`
   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error[E0308]: mismatched types
  --> $DIR/missing-universe-cause-issue-114907.rs:33:5
   |
LL |     accept(callback);
   |     ^^^^^^^^^^^^^^^^ one type is more general than the other
   |
   = note: expected trait `for<'a> FnOnce(&'a ())`
              found trait `FnOnce(&())`
note: this closure does not fulfill the lifetime requirements
  --> $DIR/missing-universe-cause-issue-114907.rs:32:20
   |
LL |     let callback = |_| {};
   |                    ^^^
note: the lifetime requirement is introduced here
  --> $DIR/missing-universe-cause-issue-114907.rs:20:21
   |
LL | struct Handshake<R: Role> {
   |                     ^^^^
help: consider specifying the type of the closure parameters
   |
LL |     let callback = |_: &_| {};
   |                    ~~~~~~~

error: higher-ranked subtype error
  --> $DIR/missing-universe-cause-issue-114907.rs:33:21
   |
LL |     accept(callback);
   |                     ^

error: higher-ranked subtype error
  --> $DIR/missing-universe-cause-issue-114907.rs:33:21
   |
LL |     accept(callback);
   |                     ^
   |
   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error: aborting due to 6 previous errors

For more information about this error, try `rustc --explain E0308`.