-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Internal compiler error anonymous bound region BrAnon(0) in binding but not trait ref #62200
Comments
Reduced: pub trait SIterator {}
pub trait Ty<'a> {
type V;
}
struct FilterMap<F>(F);
impl<X, F> SIterator for FilterMap<F>
where
F: FnOnce(<X as Ty<'_>>::V) -> Option<<X as Ty<'_>>::V>
{} |
seems like this bug dates at least to when |
bug dates back to at least nightly-2017-10-15 and perhaps earlier. It seems reasonable right now to assume its been present ever since |
I'm going to have to do some background reading to remember what we are supposed to do in a case like this. If you remove the occurrences of
|
triage: P-medium. Removing nomination. Assigning to self. |
I just ran into this on 1.41.1. Attempted to minimize what I was doing and ended up basically identical to Centril's above. struct S {}
trait T<'a>{
type A;
}
impl T<'_> for S {
type A = u32;
}
fn foo(x: impl Fn(<S as T>::A) -> <S as T>::A) {
} |
If it helps, this slightly modified snippet produces no ICE but a very odd error: struct S {}
trait T<'a>{
type A;
}
impl T<'_> for S {
type A = i32;
}
fn foo<'a>(x: impl Fn(<S as T>::A) -> <S as T<'a>>::A) {
x(2i32);
}
fn main() {
foo(|x| x);
}
In that code |
Seems related to #62201 struct S {}
trait T<'a> {
type A;
}
impl T<'_> for S {
type A = i32;
}
fn foo<'a>(x: impl Fn(<S as T>::A) -> <S as T<'a>>::A) {
help(x, 2i32);
}
fn help<'a, TT: T<'a>, F>(f: F, t: <TT as T<'a>>::A) -> <TT as T<'a>>::A
where
F: Fn(<TT as T>::A) -> <TT as T<'a>>::A,
{
f(t)
}
fn main() {
foo(|x| x)
}
Playground |
The following code causes an error
(Playground)
Errors:
The text was updated successfully, but these errors were encountered: