Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
aliemjay opened this issue Oct 16, 2023 · 1 comment · Fixed by #116733
Closed

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

aliemjay opened this issue Oct 16, 2023 · 1 comment · Fixed by #116733
Assignees
Labels
A-impl-trait Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch. C-bug Category: This is a bug. P-medium Medium priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-types Relevant to the types team, which will review and decide on the PR/issue.

Comments

@aliemjay
Copy link
Member

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);
}
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 16, 2023
@aliemjay aliemjay added regression-from-stable-to-stable Performance or correctness regression from one stable version to another. A-impl-trait Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch. C-bug Category: This is a bug. T-types Relevant to the types team, which will review and decide on the PR/issue. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Oct 16, 2023
@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Oct 16, 2023
@compiler-errors compiler-errors self-assigned this Oct 16, 2023
@apiraino
Copy link
Contributor

WG-prioritization assigning priority (Zulip discussion).

@rustbot label -I-prioritize +P-medium

@rustbot rustbot added P-medium Medium priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Oct 17, 2023
@bors bors closed this as completed in ec2b311 Oct 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-impl-trait Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch. C-bug Category: This is a bug. P-medium Medium priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-types Relevant to the types team, which will review and decide on the PR/issue.
Projects
None yet
4 participants