@@ -8,13 +8,14 @@ Coherence checking is what detects both of trait impls and inherent impls overla
88Overlapping trait impls always produce an error,
99while overlapping inherent impls result in an error only if they have methods with the same name.
1010
11- Checking for overlaps is split in two parts. First there's the [ overlap check(s)] ( #overlap-checks ) ,
11+ Checking for overlaps is split in two parts.
12+ First there's the [ overlap check(s)] ( #overlap-checks ) ,
1213which finds overlaps between traits and inherent implementations that the compiler currently knows about.
1314
1415However, Coherence also results in an error if any other impls ** could** exist,
15- even if they are currently unknown.
16+ even if they are currently unknown.
1617This affects impls which may get added to upstream crates in a backwards compatible way,
17- and impls from downstream crates.
18+ and impls from downstream crates.
1819This is called the Orphan check.
1920
2021## Overlap checks
@@ -25,7 +26,7 @@ Overlap checks always consider pairs of implementations, comparing them to each
2526
2627Overlap checking for inherent impl blocks is done through ` fn check_item ` (in coherence/inherent_impls_overlap.rs),
2728where you can very clearly see that (at least for small ` n ` ), the check really performs ` n^2 `
28- comparisons between impls.
29+ comparisons between impls.
2930
3031In the case of traits, this check is currently done as part of building the [ specialization graph] ( traits/specialization.md ) ,
3132to handle specializing impls overlapping with their parent, but this may change in the future.
@@ -37,7 +38,7 @@ Overlapping is sometimes partially allowed:
37381 . for marker traits
38392 . under [ specialization] ( traits/specialization.md )
3940
40- but normally isn't.
41+ but normally isn't.
4142
4243The overlap check has various modes (see [ ` OverlapMode ` ] ).
4344Importantly, there's the explicit negative impl check, and the implicit negative impl check.
@@ -47,9 +48,9 @@ Both try to prove that an overlap is definitely impossible.
4748
4849### The explicit negative impl check
4950
50- This check is done in [ ` impl_intersection_has_negative_obligation ` ] .
51+ This check is done in [ ` impl_intersection_has_negative_obligation ` ] .
5152
52- This check tries to find a negative trait implementation.
53+ This check tries to find a negative trait implementation.
5354For example:
5455
5556``` rust
0 commit comments