Seems to stack overflow (I think it's one... on Linux it does give "segfault", technically, and on Windows it produces "thread 'rustc' has overflowed its stack").
(Current nightly behaves like current stable.)
trait Fn1<T>: Fn(T) -> <Self as Fn1<T>>::Output {
type Output;
}
impl<F: ?Sized, T, O> Fn1<T> for F where F: Fn(T) -> O {type Output = O;}
trait Trait<'a1, 'a2> {}
impl<S: ?Sized> Trait<'_, '_> for S {}
fn foo<'a>(request: &'a str) -> impl for<'b> Fn1<&'b (), Output = impl Trait<'a, 'b>> {
move |_: &()| ()
}
(playground)
Haven't tried much to minimize further yet, perhaps this can also be done, somehow, without using a closure? Nevermind, I removed the need for closures now
trait Fn1<T> {
type Output;
}
impl<T, S: ?Sized> Fn1<T> for S {
type Output = ();
}
trait Trait<'a> {}
impl<'a, S: ?Sized> Trait<'a> for S {}
fn foo() -> impl for<'b> Fn1<&'b (), Output = impl Trait<'b>> {
()
}
The same code used to give various ICEs in older Rust versions, stack overflow seems to be since 1.57. I don't have time to investigate further today.
@rustbot label I-crash, A-impl-trait, A-lifetimes, A-closures, T-compiler
@rustbot label -A-closures
Labeling question: is ICE -> crash a regression?
Seems to stack overflow (I think it's one... on Linux it does give "segfault", technically, and on Windows it produces "thread 'rustc' has overflowed its stack").
(Current nightly behaves like current stable.)
(playground)
Haven't tried much to minimize further yet, perhaps this can also be done, somehow, without using a closure?Nevermind, I removed the need for closures nowThe same code used to give various ICEs in older Rust versions, stack overflow seems to be since 1.57. I don't have time to investigate further today.
@rustbot label I-crash, A-impl-trait, A-lifetimes,
A-closures,T-compiler@rustbot label -A-closures
Labeling question: is
ICE -> crasha regression?