@@ -63,6 +63,40 @@ help: consider specifying the type of the closure parameters
6363LL | let callback = |_: &_| {};
6464 | ~~~~~~~
6565
66+ error: implementation of `FnOnce` is not general enough
67+ --> $DIR/missing-universe-cause-issue-114907.rs:33:5
68+ |
69+ LL | accept(callback);
70+ | ^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough
71+ |
72+ = note: closure with signature `fn(&'2 ())` must implement `FnOnce<(&'1 (),)>`, for any lifetime `'1`...
73+ = note: ...but it actually implements `FnOnce<(&'2 (),)>`, for some specific lifetime `'2`
74+ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
75+
76+ error[E0308]: mismatched types
77+ --> $DIR/missing-universe-cause-issue-114907.rs:33:5
78+ |
79+ LL | accept(callback);
80+ | ^^^^^^^^^^^^^^^^ one type is more general than the other
81+ |
82+ = note: expected trait `for<'a> FnOnce(&'a ())`
83+ found trait `FnOnce(&())`
84+ note: this closure does not fulfill the lifetime requirements
85+ --> $DIR/missing-universe-cause-issue-114907.rs:32:20
86+ |
87+ LL | let callback = |_| {};
88+ | ^^^
89+ note: the lifetime requirement is introduced here
90+ --> $DIR/missing-universe-cause-issue-114907.rs:20:21
91+ |
92+ LL | struct Handshake<R: Role> {
93+ | ^^^^
94+ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
95+ help: consider specifying the type of the closure parameters
96+ |
97+ LL | let callback = |_: &_| {};
98+ | ~~~~~~~
99+
66100error: higher-ranked subtype error
67101 --> $DIR/missing-universe-cause-issue-114907.rs:33:21
68102 |
@@ -77,6 +111,6 @@ LL | accept(callback);
77111 |
78112 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
79113
80- error: aborting due to 6 previous errors
114+ error: aborting due to 8 previous errors
81115
82116For more information about this error, try `rustc --explain E0308`.
0 commit comments