]>
Commit | Line | Data |
---|---|---|
0731742a XL |
1 | # `re_rebalance_coherence` |
2 | ||
3 | The tracking issue for this feature is: [#55437] | |
4 | ||
5 | [#55437]: https://github.com/rust-lang/rust/issues/55437 | |
6 | ||
7 | ------------------------ | |
8 | ||
9 | The `re_rebalance_coherence` feature tweaks the rules regarding which trait | |
10 | impls are allowed in crates. | |
11 | The following rule is used: | |
12 | ||
13 | Given `impl<P1..=Pn> Trait<T1..=Tn> for T0`, an impl is valid only if at | |
14 | least one of the following is true: | |
15 | - `Trait` is a local trait | |
16 | - All of | |
17 | - At least one of the types `T0..=Tn` must be a local type. Let `Ti` be the | |
18 | first such type. | |
19 | - No uncovered type parameters `P1..=Pn` may appear in `T0..Ti` (excluding | |
20 | `Ti`) | |
21 | ||
22 | ||
23 | See the [RFC](https://github.com/rust-lang/rfcs/blob/master/text/2451-re-rebalancing-coherence.md) for details. |