rust/tests/ui/nll/missing-universe-cause-issue-114907.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

83 lines
2.9 KiB
Plaintext
Raw Normal View History

2023-08-30 14:10:52 +00:00
error[E0308]: mismatched types
--> $DIR/missing-universe-cause-issue-114907.rs:33:5
|
LL | accept(callback);
| ^^^^^^^^^^^^^^^^ one type is more general than the other
|
2023-11-24 22:09:59 +00:00
= note: expected trait `for<'a> FnOnce(&'a ())`
found trait `FnOnce(&())`
2023-08-30 14:10:52 +00:00
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`
2023-10-04 18:34:50 +00:00
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
2023-08-30 14:10:52 +00:00
error[E0308]: mismatched types
--> $DIR/missing-universe-cause-issue-114907.rs:33:5
|
LL | accept(callback);
| ^^^^^^^^^^^^^^^^ one type is more general than the other
|
2023-11-24 22:09:59 +00:00
= note: expected trait `for<'a> FnOnce(&'a ())`
found trait `FnOnce(&())`
2023-08-30 14:10:52 +00:00
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);
| ^
2023-10-04 18:34:50 +00:00
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
2023-08-30 14:10:52 +00:00
error: aborting due to 6 previous errors
For more information about this error, try `rustc --explain E0308`.