This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit 3971c3c
committed
Auto merge of rust-lang#132961 - adetaylor:arbitrary-self-types-the-big-bit, r=<try>
Arbitrary self types v2: main compiler changes
This is the main PR in a series of PRs related to Arbitrary Self Types v2, tracked in rust-lang#44874. Specifically this is step 7 of the plan [described here](rust-lang#44874 (comment)), for [RFC 3519](rust-lang/rfcs#3519).
Overall this PR:
* Switches from the `Deref` trait to the new `Receiver` trait when the unstable `arbitrary_self_types` feature is enabled (the simple bit)
* Introduces new algorithms to spot "shadowing"; that is, the case where a newly-added method in an outer smart pointer might end up overriding a pre-existing method in the pointee (the complex bit). Most of this bit was explored in [this earlier perf-testing PR](rust-lang#127812 (comment)).
* Lots of tests
This should not break compatibility for:
* Stable users, where it should have no effect
* Users of the existing `arbitrary_self_types` feature (because we implement `Receiver` for `T: Deref`) _unless_ those folks have added methods which may shadow methods in inner types, which we no longer want to allow
Subsequent PRs will add better diagnostics.
It's probably easiest to review this commit-by-commit.
r? `@wesleywiser`File tree
50 files changed
+1737
-196
lines changed- compiler
- rustc_error_codes/src/error_codes
- rustc_hir_analysis
- src
- check
- rustc_hir_typeck/src
- method
- rustc_middle/src/traits
- tests/ui
- async-await
- feature-gates
- issues
- lifetimes
- methods
- self
- span
- suggestions
- traits
- const-traits/effects/auxiliary
- type-alias-impl-trait
- ufcs
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
50 files changed
+1737
-196
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
69 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
70 | 72 | | |
71 | 73 | | |
72 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
244 | | - | |
| 244 | + | |
245 | 245 | | |
246 | 246 | | |
247 | | - | |
| 247 | + | |
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
| |||
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
30 | 33 | | |
31 | 34 | | |
32 | 35 | | |
| |||
39 | 42 | | |
40 | 43 | | |
41 | 44 | | |
| 45 | + | |
42 | 46 | | |
43 | 47 | | |
44 | 48 | | |
| |||
69 | 73 | | |
70 | 74 | | |
71 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
72 | 80 | | |
73 | 81 | | |
74 | 82 | | |
| |||
111 | 119 | | |
112 | 120 | | |
113 | 121 | | |
114 | | - | |
| 122 | + | |
115 | 123 | | |
116 | 124 | | |
117 | 125 | | |
| |||
125 | 133 | | |
126 | 134 | | |
127 | 135 | | |
| 136 | + | |
128 | 137 | | |
129 | 138 | | |
130 | 139 | | |
| |||
137 | 146 | | |
138 | 147 | | |
139 | 148 | | |
140 | | - | |
141 | | - | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
142 | 156 | | |
143 | 157 | | |
144 | 158 | | |
| |||
151 | 165 | | |
152 | 166 | | |
153 | 167 | | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
| 168 | + | |
| 169 | + | |
159 | 170 | | |
160 | 171 | | |
161 | 172 | | |
| |||
234 | 245 | | |
235 | 246 | | |
236 | 247 | | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
237 | 256 | | |
238 | 257 | | |
239 | 258 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1808 | 1808 | | |
1809 | 1809 | | |
1810 | 1810 | | |
| 1811 | + | |
| 1812 | + | |
| 1813 | + | |
| 1814 | + | |
| 1815 | + | |
| 1816 | + | |
| 1817 | + | |
1811 | 1818 | | |
1812 | 1819 | | |
1813 | 1820 | | |
1814 | 1821 | | |
1815 | 1822 | | |
1816 | | - | |
1817 | | - | |
1818 | 1823 | | |
1819 | 1824 | | |
1820 | 1825 | | |
| |||
1836 | 1841 | | |
1837 | 1842 | | |
1838 | 1843 | | |
1839 | | - | |
| 1844 | + | |
1840 | 1845 | | |
1841 | | - | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
1842 | 1849 | | |
1843 | | - | |
| 1850 | + | |
1844 | 1851 | | |
1845 | 1852 | | |
1846 | 1853 | | |
| |||
1853 | 1860 | | |
1854 | 1861 | | |
1855 | 1862 | | |
1856 | | - | |
| 1863 | + | |
1857 | 1864 | | |
1858 | 1865 | | |
1859 | 1866 | | |
| |||
1862 | 1869 | | |
1863 | 1870 | | |
1864 | 1871 | | |
1865 | | - | |
| 1872 | + | |
1866 | 1873 | | |
1867 | | - | |
| 1874 | + | |
1868 | 1875 | | |
1869 | 1876 | | |
1870 | 1877 | | |
1871 | 1878 | | |
1872 | | - | |
| 1879 | + | |
1873 | 1880 | | |
1874 | 1881 | | |
1875 | 1882 | | |
1876 | 1883 | | |
1877 | 1884 | | |
1878 | 1885 | | |
1879 | 1886 | | |
1880 | | - | |
| 1887 | + | |
1881 | 1888 | | |
1882 | 1889 | | |
1883 | 1890 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
917 | 917 | | |
918 | 918 | | |
919 | 919 | | |
920 | | - | |
| 920 | + | |
921 | 921 | | |
922 | 922 | | |
923 | 923 | | |
| |||
0 commit comments