-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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: Failed to unify obligation #43623
Labels
C-bug
Category: This is a bug.
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
P-medium
Medium priority
Comments
Another version: struct A;
struct B;
trait Foo<'a> {
type Bar;
}
impl<'a> Foo<'a> for B {
type Bar = A;
}
trait Bar: for<'a> Foo<'a> {
fn f<F: for<'a> FnOnce(<Self as Foo<'a>>::Bar)>(&mut self, f: F) {}
}
impl Bar for B {}
fn main() {
B.f(drop);
} |
triage: p-medium |
minimal version pub trait Trait<'a> {
type Assoc;
}
pub struct Type;
impl<'a> Trait<'a> for Type {
type Assoc = ();
}
pub fn break_me<T, F>(f: F)
where T: for<'b> Trait<'b>,
F: for<'b> FnMut(<T as Trait<'b>>::Assoc) {
break_me::<Type, fn(_)>;
} Note that if you pass in the closure i.e. pub trait Trait<'a> {
type Assoc;
}
pub struct Type;
impl<'a> Trait<'a> for Type {
type Assoc = ();
}
pub fn break_me<T, F>(f: F)
where T: for<'b> Trait<'b>,
F: for<'b> FnMut(<T as Trait<'b>>::Assoc) {
break_me::<Type, _>(|_| ()); // this is fine
} |
@michaelwoerister, none of the programs provided seem to ICE with the latest nightly. |
Centril
added a commit
to Centril/rust
that referenced
this issue
Aug 9, 2019
…tril Add tests for some ICEs Closes rust-lang#43623 Closes rust-lang#44405 r? @Centril
Centril
added a commit
to Centril/rust
that referenced
this issue
Aug 9, 2019
…tril Add tests for some ICEs Closes rust-lang#43623 Closes rust-lang#44405 r? @Centril
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.
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
P-medium
Medium priority
The compiler ices with error "Failed to unify obligation" when I try to compile the following code:
I get the following error:
Meta
rustc --version --verbose
:Backtrace:
The text was updated successfully, but these errors were encountered: