-
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 on stable / nightly: ReEmpty #55608
Comments
(sorry for the label noise; I was doing some bisection but then realized I hadn't set up the test correctly in the first place...) |
(I've been trying to identify whether this is a regression; its not immediately trivial because the provided test involves crates that require a relatively recent (stable) rust version, but the most recent ones trigger the failure in question. I may switch to attempting to derive a standalone test rather than continuing to work with the steps-to-reproduce that were provided. |
Just to clarify my previous comment: the crate in question does not build with rust 1.25 because So, I'm going to try to derive a standalone test case now. |
Reduced to the following: fn server() -> impl FilterBase2 {
segment2(|| { loop { } }).map2(|| "")
}
trait FilterBase2 {
fn map2<F>(self, _fn: F) -> Map2<F> where Self: Sized { loop { } }
}
struct Map2<F> { _func: F }
impl<F> FilterBase2 for Map2<F> { }
fn segment2<F>(_fn: F) -> Map2<F> where F: Fn() -> Result<(), ()> {
loop { }
}
fn main() { server(); } |
I don't think this is a stable-to-stable regression. I cannot find a stable version of rust after the stabilization of But it might be a nightly regression. Looking now. |
Okay, so after adding Anyway here's the point where an ICE was introduced (though its message is not 100% the same as the one we currently see:
|
After fixing the root cause of the ICE (
|
…g_span_from_free_region, r=estebank Fix ICE in msg_span_from_free_region on ReEmpty On an example like this: ```rust #![feature(conservative_impl_trait)] fn server() -> impl FilterBase2 { segment2(|| { loop { } }).map2(|| "") } trait FilterBase2 { fn map2<F>(self, _fn: F) -> Map2<F> where Self: Sized { loop { } } } struct Map2<F> { _func: F } impl<F> FilterBase2 for Map2<F> { } fn segment2<F>(_fn: F) -> Map2<F> where F: Fn() -> Result<(), ()> { loop { } } ``` we now, instead of ICE'ing, get a diagnostic like: ``` error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds --> issue-55608.rs:3:16 | 3 | fn server() -> impl FilterBase2 { | ^^^^^^^^^^^^^^^^ | = note: hidden type `Map2<[closure@issue-55608.rs:4:36: 4:41]>` captures an empty lifetime ``` Fix rust-lang#55608
…g_span_from_free_region, r=estebank Fix ICE in msg_span_from_free_region on ReEmpty On an example like this: ```rust #![feature(conservative_impl_trait)] fn server() -> impl FilterBase2 { segment2(|| { loop { } }).map2(|| "") } trait FilterBase2 { fn map2<F>(self, _fn: F) -> Map2<F> where Self: Sized { loop { } } } struct Map2<F> { _func: F } impl<F> FilterBase2 for Map2<F> { } fn segment2<F>(_fn: F) -> Map2<F> where F: Fn() -> Result<(), ()> { loop { } } ``` we now, instead of ICE'ing, get a diagnostic like: ``` error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds --> issue-55608.rs:3:16 | 3 | fn server() -> impl FilterBase2 { | ^^^^^^^^^^^^^^^^ | = note: hidden type `Map2<[closure@issue-55608.rs:4:36: 4:41]>` captures an empty lifetime ``` Fix rust-lang#55608
Thanks @pnkfelix! |
Summary: - A few tests that used to compile, but which were highly questionable, now fail to compile. These are tests that also fail under NLL -- they have to do with closures that are returning invalid values (e.g., other closures that contain values that would be out of scope if used), but our regionck rules permitted them for some reason. - One test for rust-lang#55608 now compiles successfully -- looking at it, I can't I see any reason that it should *not* compile. - Some errors messages changed in small ways, in some cases improving quite a bit, but often just "different".
Reduced test case (play):
Original Bug Report follows
Error:
Cargo.toml:
src/lib.rs:
rustc 1.30.0 (da5f414 2018-10-24):
rustc 1.32.0-nightly (451987d 2018-11-01):
The text was updated successfully, but these errors were encountered: