librustc: Ensure that proc upvars have static lifetime.
Since procs do not have lifetime bounds, we must do this to maintain safety. This can break code that incorrectly captured references in procedure types. Change such code to not do this, perhaps with a trait object instead. A better solution would be to add higher-rank lifetime support to procs. However, this would be a lot of work for a feature we want to remove in favor of unboxed closures. The corresponding "real fix" is #15067. Closes #14036. [breaking-change]
Showing
想要评论请 注册 或 登录