Skip to content

Instantly share code, notes, and snippets.

@lqd

lqd/57362.diff Secret

Created January 16, 2019 19:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lqd/a9a8f8c173735299e75c4804b764c20c to your computer and use it in GitHub Desktop.
Save lqd/a9a8f8c173735299e75c4804b764c20c to your computer and use it in GitHub Desktop.
error[E0308]: mismatched types
--> src/main.rs:13:7
|
13 | a.f();
| ^ one type is more general than the other
|
- = note: expected type `Trait`
- found type `Trait`
+ = note: expected trait `Trait` to be implemented for `fn(&u8)`
+ found trait `Trait` implemented for `for<'r> fn(&'r _)`
error[E0308]: mismatched types
--> src/lib.rs:31:13
|
31 | let x = <fn (&())>::make_g();
| ^^^^^^^^^^^^^^^^^^ one type is more general than the other
|
- = note: expected type `X`
- found type `X`
+ = note: expected trait `X` to be implemented for `for<'r> fn(&'r ())`
+ found trait `X` implemented for `fn(&())`
error[E0308]: mismatched types
--> src/lib.rs:36:13
|
36 | let x = <fn (&())>::make_f();
| ^^^^^^^^^^^^^^^^^^ one type is more general than the other
|
- = note: expected type `Y`
- found type `Y`
+ = note: expected trait `Y` to be implemented for `for<'r> fn(&'r ())`
+ found trait `Y` implemented for `fn(_)`
LL | foo(());
| ^^^ one type is more general than the other
|
- = note: expected type `Mirror`
- found type `Mirror`
+ = note: expected trait `Mirror` to be implemented for `&'a _`
+ found trait `Mirror` implemented for `_`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment