Skip to content

temporary lifetime around await is (maybe) unexpectedly short #63832

Closed
@nikomatsakis

Description

@nikomatsakis

So @sfackler pointed out something to me. The problem @sfackler reported was that temporary lifetimes around await were too short. The effect was that foo(&[123]).await would give an error where foo(&[123]) would not (in sync code). My assumption was that this was caused by our temporary lifetimes being derived from the desugared version of await, which doesn't seem like what one might expect.

Here is an example showing the problem:

async version, playground

sync version, playground

Metadata

Metadata

Assignees

Labels

A-async-awaitArea: Async & AwaitAsyncAwait-PolishAsync-await issues that are part of the "polish" areaT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions