Skip to content

uncaptured lifetimes required to live as long as the opaque type #116794

Closed

Description

@aliemjay

The following valid code stopped compiling since v1.67, most likely due to #103491:

fn opaque<'a: 'a>(_: &'a str) -> *mut impl Sized {
    &mut ()
}

fn main() {
    let x = opaque(&String::new()); //~ ERROR temporary value dropped while borrowed
    drop(x);
}

Activity

  1. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Oct 16, 2023
  2. added
    regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.
    A-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.
    C-bugCategory: This is a bug.
    T-typesRelevant to the types team, which will review and decide on the PR/issue.
    and removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Oct 16, 2023
  3. added
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Oct 16, 2023
  4. apiraino commented on Oct 17, 2023

    @apiraino
    Contributor

    WG-prioritization assigning priority (Zulip discussion).

    @rustbot label -I-prioritize +P-medium

  5. added and removed
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Oct 17, 2023
  6. added a commit that references this issue on Oct 29, 2023
    ec2b311
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

A-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.C-bugCategory: This is a bug.P-mediumMedium priorityT-typesRelevant to the types team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions