Follow-up to #83. There's two minor motivations to the change here:
Protect against future changes to coercion/inference. By fully specifying the function pointer type, we can ensure that no coercion happens before the closure captures &#ty.
e.g. inserting an explicit coercion point with (|| &#ident as _) causes the current tyck to fail.
Improve the error message by populating 'static lifetimes, making the type mismatch more directly comparable.
Also removes linkme::__private::value, as that helper function is no longer used.
The chance that a coercion could break the check done by #83 is reasonably low and would be caught on CI, and the error improvement is debatable at best, so it's a judgement call on whether these changes should be merged.
Follow-up to #83. There's two minor motivations to the change here:
&#ty
.(|| &#ident as _)
causes the current tyck to fail.'static
lifetimes, making the type mismatch more directly comparable.Also removes
linkme::__private::value
, as that helper function is no longer used.The chance that a coercion could break the check done by #83 is reasonably low and would be caught on CI, and the error improvement is debatable at best, so it's a judgement call on whether these changes should be merged.