-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Rustc 1.33 stable panicked on a closure inside a closure #58840
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
After some testing, this is the lines |
@julien1619 can you post a reduced test case or the full source including Cargo.toml and the module files? |
Simple project that causes this: |
Bisected, the cause of the regression is #55517. cc @nikomatsakis @scalexm |
triage: P-high. |
assigning to self based on stack trace and related work on region-vid conversion issues, and removing nomination tag. |
Is this likely to be in a 1.33.1 release? |
If we do a release and the fix is not risky to land in a point release probably yes, but there aren't other point release worthy issues to fix so I'm not sure if we'll end up doing one. |
This is currently blocking us from updating to 1.33. |
Judging from our code and the code above, it might be related to |
This project has been deleted. Can someone either repost it, or share a copy with me? |
The comment below is now posted separately as #59494. Not sure if it triggers the same bug, but I found this issue (in details below) while searching for a solution. This code panics on 1.33 - 1.35, but does not panic on 1.32: fn t7p<A,B,C>( f:impl Fn(B) -> C, g:impl Fn(A) -> B ) -> impl Fn(A) -> C
{
move |a:A| -> C { f(g(a)) }
}
fn t8n<A,B,C>( f:impl Fn(A) -> B, g:impl Fn(A) -> C ) -> impl Fn(A) -> (B,C)
where
A: Copy
{
move |a:A| -> (B,C) {
let b = a;
let fa = f(a);
let ga = g(b);
(fa, ga)
}
}
fn main() {
let f = |(_,_)| { };
let g = |(a,_)| { a };
let t7 = |env| { |a| { |b| { t7p(f, g)(((env,a),b)) }}};
let t8 = t8n(t7, t7p(f, g));
} On 1.32:
On 1.35 nightly (today):
--Bryan |
@bryturner based on the stack trace, I do not think that is the exact same bug. Thanks for investigating; Lets make sure to file a separate issue for it! |
@bryturner also, your code seems to be missing the definition for |
I probably should have pinged @jatsrt when I wrote that question. Let's seeing if pinging here helps. |
Since the sample project that causes this was taken down, I guessed I will take an example from either #59606 or #59344 and use that as the basis for investigation going forward. #59344 in particular seems to have the best bet of having enough information (namely a |
@pnkfelix I've just checked on Rust 1.34.1 and I confirm the bug is still present. @darnuria and @GuillaumeGomez told me yesterday at the Paris meetup to bump this issue. I'll try to create a minimal testcase later today. |
cc @rust-lang/compiler |
Compiler triage: It seems like are still missing a case for reproduction? |
@pietroalbini do you still have a local checkout of @jatsrt's repro? |
@julien1619 by the way, were you able to create the minimal testcase you mentioned ? |
@jethrogb nope :( |
I created a simple (but not minimal) project based on the initial comment, and checked it indeed ICEs on nightly with the expected "cannot convert I haven't tried minimizing or bisecting, however (but since very similar errors had been fixed by #60449, I thought this issue here would have been fixed at the same time — so maybe it won't be bisected to the Universes PR after all). edit: I also ran a quick bisect on it, and it started ICEing (with a different error location) in A minimization would be very helpful indeed. |
@lqd if I change
|
Got it: diff --git a/src/deps.rs b/src/deps.rs
index d5ad25a..a10b259 100644
--- a/src/deps.rs
+++ b/src/deps.rs
@@ -48,6 +48,7 @@ where
{
let requests: Vec<JuniperGraphQLRequest<S>> = vec![];
future::join_all(requests.into_iter().map(move |request| {
+ let root_node = root_node.clone();
future::poll_fn(move || {
let _res = request.execute(&root_node);
Ok(Async::Ready(())) |
Reduced: trait Future {
type Item;
}
struct PollFn<F> {
_i: F,
}
fn poll_fn<T, F>(_: F) -> PollFn<F>
where
F: FnMut() -> T,
{
unimplemented!()
}
impl<T, F> Future for PollFn<F>
where
F: FnMut() -> T,
{
type Item = T;
}
struct JoinAll<I>
where
I: IntoIterator,
I::Item: Future,
{
_f: I::Item,
}
fn join_all<I>(_: I) -> JoinAll<I>
where
I: IntoIterator,
I::Item: Future,
{
unimplemented!()
}
impl<I> Future for JoinAll<I>
where
I: IntoIterator,
I::Item: Future,
{
type Item = I;
}
fn f<'a, T: 'a>(r: &'a T) -> impl Future + 'a {
let requests = Vec::<()>::new();
join_all(requests.into_iter().map(move |_| {
poll_fn(move || {
r;
})
}))
}
fn main() {
|| -> Box<Send> { Box::new(f(&())) };
} Since this involves IntoIterator, it makes me think of another recent ICE involving universes, but I can't find the exact issue right now. |
Maybe #58375? |
…i-obk Fix more escaping ReScopes Closes #58840
I manually checked the latest nightly on the bigger repro project, and we have the expected |
Rustc 1.33 panicked while compiling a code that was working well on 1.32.
I tried this code:
This happened:
error: internal compiler error: src/librustc_mir/borrow_check/nll/universal_regions.rs:744: cannot convert `ReScope(Node(238))` to a region vid
Meta
rustc --version --verbose
:Backtrace:
The text was updated successfully, but these errors were encountered: