@@ -62,15 +62,13 @@ then the candidate types would be `&SmartPtr<Foo>`, `SmartPtr<Foo>` and `Foo`.
62
62
This list of candidate types is then converted to a list of candidate methods.
63
63
For each step, the candidate type is used to determine what searches to perform:
64
64
65
- * For a struct, enum, or foreign type, there is a search for inherent
66
- impl candidates for the type.
65
+ * For a struct, enum, foreign type, or various simpler types (listed below)
66
+ there is a search for inherent impl candidates for the type.
67
67
* For a type param, there's a search for inherent candidates on the param.
68
68
* For a trait object, there is first a search for inherent candidates for
69
69
the trait (for example in ` impl Trait ` blocks), then inherent impl
70
70
candidates for the trait object itself (for example found in ` impl dyn Trait `
71
- blocks)
72
- * For various simpler types (listed below) there's a search for inherent
73
- candidates for the incoherent type.
71
+ blocks).
74
72
75
73
After these occur, there's a further search for extension candidates for
76
74
traits in scope.
@@ -146,9 +144,10 @@ only the `Receiver` chain.
146
144
147
145
There are a few details not considered in this overview:
148
146
149
- * The search for candidate methods will also consider searches for
150
- incoherent types if ` rustc_has_incoherent_inherent_impls ` is active for
151
- a ` dyn ` , struct, enum, or foreign type.
147
+ * The search for candidate methods will search more widely (potentially
148
+ across crates) for certain [ incoherent] types: that includes any of
149
+ the "various simpler types" listed above, and a ` dyn ` , struct, enum, or
150
+ foreign type if ` rustc_has_incoherent_inherent_impls ` is active.
152
151
* If there are multiple candidates from traits, they may in fact be
153
152
identical, and the picking operation collapses them to a single pick to avoid
154
153
reporting conflicts.
@@ -228,3 +227,4 @@ There are a few details not considered in this overview:
228
227
[`IntoIterator `]: std :: iter :: IntoIterator
229
228
[inherent ]: .. / items / implementations . md#inherent - implementations
230
229
[methods on traits ]: .. / items / implementations . md#trait - implementations
230
+ [incoherent ]: .. / items / implementations . md#trait - implementation - coherence
0 commit comments