I suspect single_use_lifetimes does not correctly verify whether the compiler feature is available. My understanding is that it will be stabilized in 2024 edition (https://github.com/rust-lang/rust/issues/117587).
Meta
If you're using the stable version of the compiler, you should also check if the
bug also exists in the beta or nightly versions.
I tried in the playground by setting "nightly" and both 2021 and 2024 editions, and the problem is currently still there.
Consider this code (playground):
The warning is issued:
warning: lifetime parameter `'a` only used once
. However, removing the lifetime as suggested makes code to not compile:So the compiler contradicts itself.
I suspect
single_use_lifetimes
does not correctly verify whether the compiler feature is available. My understanding is that it will be stabilized in 2024 edition (https://github.com/rust-lang/rust/issues/117587).Meta
I tried in the playground by setting "nightly" and both 2021 and 2024 editions, and the problem is currently still there.