-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Generic (&A -> T) -> (&'a A -> Box<dyn Any + 'a>)
crashes
#125891
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
Labels
A-borrow-checker
Area: The borrow checker
C-bug
Category: This is a bug.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
S-has-mcve
Status: A Minimal Complete and Verifiable Example has been found for this issue
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
(&A -> T)
-> (&'a A -> Box<dyn Any + 'a>)
crashes(&A -> T) -> (&'a A -> Box<dyn Any + 'a>)
crashes
probably duplicate of #122704 |
proly related to #122704 |
I tried to minimize this, and I can't go smaller than this: trait IsStatic: 'static {}
impl<T: 'static> IsStatic for T {}
fn foo<T>(x: Box<T>) -> impl for<'a> FnOnce(&'a ()) -> Box<dyn IsStatic + 'a> {
move |_| x
} Error output
Note that the code is invalid, since it should have a Seems identical to the aforementioned #122704 except for having |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-borrow-checker
Area: The borrow checker
C-bug
Category: This is a bug.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
S-has-mcve
Status: A Minimal Complete and Verifiable Example has been found for this issue
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I'm not sure if this is a minimal example, but I couldn't shrink it any more.
Generic
T
is necessary,A
can be any type.Code
Meta
The bug exists in both the latest stable and the latest nightly.
rustc --version --verbose
:Error output
Backtrace
The text was updated successfully, but these errors were encountered: