You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rollup merge of #104753 - compiler-errors:drop-tracking-var-ice, r=oli-obk
Pass `InferCtxt` to `DropRangeVisitor` so we can resolve vars
The types that we encounter in the `TypeckResults` that we pass to the `DropRangeVisitor` are not yet fully resolved, since that only happens in writeback after type checking is complete.
Instead, pass down the whole `InferCtxt` so that we can resolve any inference vars that have been constrained since they were written into the results. This is similar to how the `MemCategorizationContext` in the `ExprUseVisitor` also needs to pass down both typeck results _and_ the inference context.
Fixes an ICE mentioned in this comment: #104382 (comment)
| |______^ implementation of `FnOnce` is not general enough
12
+
|
13
+
= note: `fn(&'0 ()) -> std::future::Ready<&'0 ()> {std::future::ready::<&'0 ()>}` must implement `FnOnce<(&'1 (),)>`, for any two lifetimes `'0` and `'1`...
14
+
= note: ...but it actually implements `FnOnce<(&(),)>`
15
+
16
+
error: implementation of `FnOnce` is not general enough
| |______^ implementation of `FnOnce` is not general enough
27
+
|
28
+
= note: `fn(&'0 ()) -> std::future::Ready<&'0 ()> {std::future::ready::<&'0 ()>}` must implement `FnOnce<(&'1 (),)>`, for any two lifetimes `'0` and `'1`...
29
+
= note: ...but it actually implements `FnOnce<(&(),)>`
30
+
31
+
error: implementation of `FnOnce` is not general enough
| |______^ implementation of `FnOnce` is not general enough
42
+
|
43
+
= note: `fn(&'0 ()) -> std::future::Ready<&'0 ()> {std::future::ready::<&'0 ()>}` must implement `FnOnce<(&'1 (),)>`, for any two lifetimes `'0` and `'1`...
44
+
= note: ...but it actually implements `FnOnce<(&(),)>`
45
+
46
+
error: implementation of `FnOnce` is not general enough
| |______^ implementation of `FnOnce` is not general enough
57
+
|
58
+
= note: `fn(&'0 ()) -> std::future::Ready<&'0 ()> {std::future::ready::<&'0 ()>}` must implement `FnOnce<(&'1 (),)>`, for any two lifetimes `'0` and `'1`...
59
+
= note: ...but it actually implements `FnOnce<(&(),)>`
0 commit comments