Closed SergioBenitez closed 1 year ago
Neither of the failures are related to this change.
Indeed, it's better to let the compiler infer the lifetimes here. Applied, thanks!
Indeed, it's better to let the compiler infer the lifetimes here.
Applied, thanks!
This isn't quite related to inference. When you specify the input and output lifetimes with the same name, you ask the compiler to unify them: to find one logical lifetime that works for both references. If instead you name one and not the other, the two lifetimes are now unrelated, and no relationship between the two is required by the compiler.
The lifetimes in several
Any
methods are restrictive in a manner that's unlikely intended. To resolve this, this PR makes changes of the following nature:The prior method signature requires that the reference to receiver have the same lifetime as the internal content of
Any
. What this means is that Rust will unify the lifetime of the receiver with that of the returned content. Since the receiver must have a shorter lifetime than the content, the lifetime of the returned content is shortened. This is unnecessary as there need not be any restriction on the receiver's lifetime.