]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #88650 - sapessi:issue-77175-fix, r=estebank
authorbors <bors@rust-lang.org>
Sat, 18 Sep 2021 11:56:23 +0000 (11:56 +0000)
committerbors <bors@rust-lang.org>
Sat, 18 Sep 2021 11:56:23 +0000 (11:56 +0000)
Skip single use lifetime lint for generated opaque types

Fix: #77175

The opaque type generated by the desugaring process of an async function uses the lifetimes defined by the originating function. The DefId for the lifetimes in the opaque type are different from the ones in the originating async function - as they should be, as far as I understand, and could therefore be considered a single use lifetimes, this causes the single_use_lifetimes lint to fail compilation if explicitly denied. This fix skips the lint for lifetimes used only once in generated opaque types for an async function that are declared in the parent async function definition.

More info in the comments on the original issue: 1 and 2


No differences found