-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 “unexpected bound ty in binder” involving type binder, Fn
-family trait and closure
#108814
Comments
Doesn't actually need ITIAP, a normal bound works just as well: #![feature(non_lifetime_binders)]
fn take<F>(_: F) where F: for<T> FnOnce(T) -> T {}
fn main() {
take(|x| x)
} |
FnOnce
and closure
It's probably fine that the following is well-typed under fn take(id: impl for<T> Fn(T) -> T) {
id(0);
id("");
} |
@fmease no need to, I've got a more minimal repro of that issue here: #![feature(non_lifetime_binders)]
trait Foo: for<T> Bar<T> {}
trait Bar<T> {
fn method() -> T;
}
fn x<T: Foo>() {
let _: i32 = T::method();
}
fn main() {} I'll need to fix this in a couple of steps. |
another one, possibly #![crate_type="lib"]
pub trait Foo<T> {
type A;
fn get::A
}
struct YetAnotherStruct<'a, I: for<isize> Foo<&'x &isize>> {
field: I::A,
} |
That ^ is a separate bug, also doesn't ICE with the code provided. I did minimize it tho:
|
FnOnce
and closureFn
-family trait and closure
Error output
Backtrace
Meta
Latest master (ac4379f).
rustc -Vv
:@rustbot label F-non_lifetime_binders
The text was updated successfully, but these errors were encountered: