]> git.proxmox.com Git - rustc.git/blame - src/doc/unstable-book/src/language-features/re-rebalance-coherence.md
New upstream version 1.40.0+dfsg1
[rustc.git] / src / doc / unstable-book / src / language-features / re-rebalance-coherence.md
CommitLineData
0731742a
XL
1# `re_rebalance_coherence`
2
3The tracking issue for this feature is: [#55437]
4
5[#55437]: https://github.com/rust-lang/rust/issues/55437
6
7------------------------
8
9The `re_rebalance_coherence` feature tweaks the rules regarding which trait
10impls are allowed in crates.
11The following rule is used:
12
13Given `impl<P1..=Pn> Trait<T1..=Tn> for T0`, an impl is valid only if at
14least 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
23See the [RFC](https://github.com/rust-lang/rfcs/blob/master/text/2451-re-rebalancing-coherence.md) for details.