Skip to content

nested rpit allows capturing illegal lifetimes #105251

Closed
@aliemjay

Description

@aliemjay

The following compiles on the current nightly (1.67.0-nightly (2022-12-03 2341517)) although it shouldn't:

fn test<'s: 's>(s: &'s str) -> impl std::future::Future<Output = impl Sized> {
    async move { let _s = s; }
}

It is correctly rejected by the current beta: 1.66.0-beta.2 (2022-11-20 0040709).

This is most likely #103491 (I haven't bisected though!). Cc @cjgillot.

@rustbot label C-bug T-compiler I-unsound regression-from-stable-to-nightly A-impl-trait

Metadata

Metadata

Assignees

Labels

A-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.C-bugCategory: This is a bug.I-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessP-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-typesRelevant to the types team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions