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 rust-lang#153694 - TKanX:bugfix/153391-cycle-error-key-param, r=nnethercote
fix(query): Pass Query Key to `value_from_cycle_error`
### Summary:
Pass the query key directly to `value_from_cycle_error` so that `FromCycleError` impls (notably `FnSig`) can use the recovered query's `DefId` instead of relying on `cycle[0]`, which is arbitrarily rotated by the parallel deadlock handler.
As suggested in [rust-lang#153644 (comment)](rust-lang#153644 (comment)).
Closesrust-lang#153391
r? @nnethercote
cc @zetanumbers
help: `B` is dyn-incompatible, use `impl B` to return an opaque type, as long as you return a single underlying type
8
+
|
9
+
LL | fn g() -> impl B;
10
+
| ++++
11
+
12
+
error[E0782]: expected a type, found a trait
13
+
--> $DIR/fn-sig-cycle-ice-153391.rs:13:23
14
+
|
15
+
LL | fn bar(&self, x: &A);
16
+
| ^
17
+
|
18
+
= note: `A` is dyn-incompatible, otherwise a trait object could be used
19
+
help: use a new generic type parameter, constrained by `A`
20
+
|
21
+
LL - fn bar(&self, x: &A);
22
+
LL + fn bar<T: A>(&self, x: &T);
23
+
|
24
+
help: you can also use an opaque type, but users won't be able to specify the type parameter when calling the `fn`, having to rely exclusively on type inference
25
+
|
26
+
LL | fn bar(&self, x: &impl A);
27
+
| ++++
28
+
29
+
error: aborting due to 2 previous errors
30
+
31
+
For more information about this error, try `rustc --explain E0782`.
0 commit comments