-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
ICE: "trans_argument: [....] invalid for pair argument" #50153
Labels
C-bug
Category: This is a bug.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
I managed to make a smaller example from my bug case, should be easier to work with as it is self contained: pub struct Resource {
internal: Box<u32>,
ptr: Box<u32>,
}
pub trait Implementation<Meta, Msg> {
fn receive(&mut self, msg: Msg, meta: Meta);
}
impl<Meta, Msg, F> Implementation<Meta, Msg> for F
where
F: FnMut(Msg, Meta) + 'static,
{
fn receive(&mut self, msg: Msg, meta: Meta) {
(self)(msg, meta)
}
}
pub fn create<A, B, Impl>(i: Impl) -> Box<Implementation<A, B>>
where
Impl: Implementation<A, B> + 'static,
{
Box::new(i)
}
pub enum Empty {}
pub fn lol() -> Box<Implementation<Resource, Empty>> {
create(
|_, _| {},
)
} |
Further minimized: pub struct Resource {
a: u8,
b: u8,
}
pub fn create<A, B, Impl>(i: Impl) -> Box<FnMut(A, B)>
where
Impl: FnMut(A, B) + 'static,
{
Box::new(i)
}
pub enum Empty {}
pub fn lol() -> Box<FnMut(Resource, Empty)> {
create(
|_, _| {},
)
} |
Above example triggers an ICE on both Debug and Release, on Stable, Beta and Nightly |
pietroalbini
added
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
C-bug
Category: This is a bug.
labels
Apr 24, 2018
This will hopefully go away when #49298 is fixed. |
The last two examples seem to work fine on the playground, is this fixed? |
No longer ICEs. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C-bug
Category: This is a bug.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Edit: see my first answer for a real minimal repro
The text was updated successfully, but these errors were encountered: