mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 01:04:03 +00:00
4275ef6c9d
Update tests of "unused_lifetimes" lint for async functions and corresponding source code Before this PR the following code would cause an error: ``` #![deny(unused_lifetimes)] async fn f<'a>(_: &'a i32) {} fn main() {} ``` It was happening because of the desugaring of return type in async functions. As a result of the desugaring, the return type contains all lifetimes involved in the function signature. And these lifetimes were interpreted separately from the same in the function scope => so they are unused. Now, all lifetimes from the return type are interpreted as used. It is also not perfect, but at least this lint doesn't cause wrong errors now. This PR connected to issues #78522, #77217 |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |