-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Commit 31788b7
committed
arbitrary_self_types: split the Autoderef chain
Receiver chain has been an extension of Deref chain,
but the consequence has been questioned as this would admit method
signatures that are deemed dubious.
It is also debatable that Receiver trait which determines applicable
`Self` type should have anything to do with dereference operation
in general.
This patch separate the two traits and isolate their use in the language.
This means that in method probing, we will chase down a Deref chain for
an applicable type for the variable `self`, from which we additionally
chase down a Receiver chain for an applicable `Self` type from a list of
methods that accepts one of these possible types of `self`.1 parent 154037f commit 31788b7
File tree
48 files changed
+537
-337
lines changed- compiler
- rustc_hir_analysis/src
- check
- rustc_hir_typeck/src/method
- rustc_middle/src
- query
- traits
- rustc_resolve/src
- library
- alloc/src
- core/src
- ops
- tests
- crashes
- ui
- deriving
- feature-gates
- methods
- self
- elision
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
48 files changed
+537
-337
lines changedLines changed: 11 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
73 | 73 |
| |
74 | 74 |
| |
75 | 75 |
| |
76 | - | ||
77 | - | ||
78 | - | ||
79 | - | ||
76 | + | ||
77 | + | ||
78 | + | ||
80 | 79 |
| |
81 | 80 |
| |
82 | 81 |
| |
83 | 82 |
| |
84 | 83 |
| |
85 | 84 |
| |
85 | + | ||
86 | + | ||
87 | + | ||
88 | + | ||
86 | 89 |
| |
87 | 90 |
| |
88 | 91 |
| |
| |||
138 | 141 |
| |
139 | 142 |
| |
140 | 143 |
| |
144 | + | ||
141 | 145 |
| |
142 | - | ||
143 | 146 |
| |
144 | 147 |
| |
145 | 148 |
| |
| |||
161 | 164 |
| |
162 | 165 |
| |
163 | 166 |
| |
164 | - | ||
167 | + | ||
165 | 168 |
| |
166 | 169 |
| |
167 | 170 |
| |
168 | 171 |
| |
169 | 172 |
| |
170 | - | ||
173 | + | ||
171 | 174 |
| |
172 | 175 |
| |
173 | 176 |
| |
| |||
244 | 247 |
| |
245 | 248 |
| |
246 | 249 |
| |
247 | - | ||
250 | + | ||
248 | 251 |
| |
249 | 252 |
| |
250 | 253 |
| |
251 | - | ||
252 | 254 |
| |
253 | 255 |
| |
254 | 256 |
| |
|
Lines changed: 9 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1734 | 1734 |
| |
1735 | 1735 |
| |
1736 | 1736 |
| |
1737 | - | ||
1737 | + | ||
1738 | + | ||
1739 | + | ||
1738 | 1740 |
| |
1739 | 1741 |
| |
1740 | 1742 |
| |
| |||
1748 | 1750 |
| |
1749 | 1751 |
| |
1750 | 1752 |
| |
1751 | - | ||
1753 | + | ||
1752 | 1754 |
| |
1753 | 1755 |
| |
1754 | 1756 |
| |
| |||
1770 | 1772 |
| |
1771 | 1773 |
| |
1772 | 1774 |
| |
1773 | - | ||
1775 | + | ||
1774 | 1776 |
| |
1775 | 1777 |
| |
1776 | 1778 |
| |
| |||
1828 | 1830 |
| |
1829 | 1831 |
| |
1830 | 1832 |
| |
1831 | - | ||
1833 | + | ||
1834 | + | ||
1835 | + | ||
1832 | 1836 |
| |
1833 | 1837 |
| |
1834 | 1838 |
| |
| |||
1882 | 1886 |
| |
1883 | 1887 |
| |
1884 | 1888 |
| |
1885 | - | ||
1889 | + | ||
1886 | 1890 |
| |
1887 | 1891 |
| |
1888 | 1892 |
| |
|
Lines changed: 26 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | + | ||
1 | 2 |
| |
2 | 3 |
| |
3 | 4 |
| |
| |||
352 | 353 |
| |
353 | 354 |
| |
354 | 355 |
| |
355 | - | ||
356 | + | ||
357 | + | ||
358 | + | ||
356 | 359 |
| |
357 | 360 |
| |
358 | 361 |
| |
359 | - | ||
360 | - | ||
361 | - | ||
362 | - | ||
363 | - | ||
362 | + | ||
363 | + | ||
364 | 364 |
| |
365 | 365 |
| |
366 | 366 |
| |
367 | + | ||
368 | + | ||
369 | + | ||
370 | + | ||
371 | + | ||
372 | + | ||
373 | + | ||
374 | + | ||
375 | + | ||
376 | + | ||
377 | + | ||
378 | + | ||
379 | + | ||
380 | + | ||
381 | + | ||
382 | + | ||
383 | + | ||
384 | + | ||
385 | + | ||
386 | + | ||
367 | 387 |
| |
368 | 388 |
| |
369 | 389 |
| |
|
0 commit comments