This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit e985804
committed
Auto merge of rust-lang#115362 - compiler-errors:non-lifetime-binder-where-clauses, r=<try>
[WIP] Support param bounds on non-lifetime binders
This PR adds resolution and AST lowering for where clauses on binders. The meaning for `for<T>` now becomes `for<T: Sized>` like regular generics positions, and you are now able to write `for<T: Trait>` (and `for<T: ?Sized>`). Binder predicates are only considered in the new solver today. Since non-lifetime binders is an incomplete feature, I don't think we need to do any messaging to tell people that they don't work correctly in the old solver, but I'll see to that in a follow-up.
This PR then adds a new `List<ty::Clause>` to binders. Most places in the compiler shouldn't care about them existing, but eventually as support for non-lifetime binders gets fleshed out we should be more careful about asserting that they're handled. This will not happen in this PR.
Tracking:
* rust-lang#108185File tree
62 files changed
+798
-343
lines changed- compiler
- rustc_ast_lowering/src
- rustc_ast_passes/src
- rustc_borrowck/src/type_check
- rustc_hir_analysis/src
- collect
- hir_ty_lowering
- rustc_hir_typeck/src
- rustc_hir/src
- rustc_infer/src/infer
- relate
- rustc_middle/src
- traits
- ty
- rustc_next_trait_solver/src/solve
- eval_ctxt
- normalizes_to
- rustc_smir/src/rustc_internal
- rustc_trait_selection/src/error_reporting/traits
- rustc_ty_utils/src
- rustc_type_ir/src
- src
- librustdoc/clean
- tools/clippy/clippy_lints/src
- tests
- crashes
- ui
- attributes
- closures/binder
- stats
- symbol-names
- traits
- non_lifetime_binders
- type-alias-impl-trait
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
62 files changed
+798
-343
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1818 | 1818 | | |
1819 | 1819 | | |
1820 | 1820 | | |
| 1821 | + | |
1821 | 1822 | | |
1822 | 1823 | | |
1823 | 1824 | | |
| |||
1846 | 1847 | | |
1847 | 1848 | | |
1848 | 1849 | | |
| 1850 | + | |
| 1851 | + | |
| 1852 | + | |
| 1853 | + | |
| 1854 | + | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
| 1859 | + | |
| 1860 | + | |
| 1861 | + | |
| 1862 | + | |
| 1863 | + | |
1849 | 1864 | | |
1850 | 1865 | | |
1851 | 1866 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
1728 | 1728 | | |
1729 | 1729 | | |
1730 | 1730 | | |
| 1731 | + | |
1731 | 1732 | | |
1732 | 1733 | | |
1733 | 1734 | | |
| |||
1948 | 1949 | | |
1949 | 1950 | | |
1950 | 1951 | | |
| 1952 | + | |
| 1953 | + | |
| 1954 | + | |
| 1955 | + | |
| 1956 | + | |
| 1957 | + | |
| 1958 | + | |
| 1959 | + | |
| 1960 | + | |
| 1961 | + | |
| 1962 | + | |
| 1963 | + | |
| 1964 | + | |
1951 | 1965 | | |
1952 | 1966 | | |
1953 | 1967 | | |
1954 | 1968 | | |
1955 | 1969 | | |
1956 | 1970 | | |
| 1971 | + | |
1957 | 1972 | | |
1958 | 1973 | | |
1959 | 1974 | | |
| |||
2362 | 2377 | | |
2363 | 2378 | | |
2364 | 2379 | | |
| 2380 | + | |
2365 | 2381 | | |
2366 | 2382 | | |
2367 | 2383 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
147 | 149 | | |
148 | 150 | | |
149 | 151 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1641 | 1641 | | |
1642 | 1642 | | |
1643 | 1643 | | |
1644 | | - | |
| 1644 | + | |
1645 | 1645 | | |
1646 | 1646 | | |
1647 | 1647 | | |
| |||
1891 | 1891 | | |
1892 | 1892 | | |
1893 | 1893 | | |
1894 | | - | |
| 1894 | + | |
1895 | 1895 | | |
1896 | 1896 | | |
1897 | 1897 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
990 | 990 | | |
991 | 991 | | |
992 | 992 | | |
| 993 | + | |
| 994 | + | |
993 | 995 | | |
994 | 996 | | |
995 | 997 | | |
| |||
3840 | 3842 | | |
3841 | 3843 | | |
3842 | 3844 | | |
| 3845 | + | |
| 3846 | + | |
| 3847 | + | |
3843 | 3848 | | |
3844 | 3849 | | |
3845 | 3850 | | |
| |||
4843 | 4848 | | |
4844 | 4849 | | |
4845 | 4850 | | |
4846 | | - | |
| 4851 | + | |
4847 | 4852 | | |
4848 | 4853 | | |
4849 | 4854 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1082 | 1082 | | |
1083 | 1083 | | |
1084 | 1084 | | |
| 1085 | + | |
1085 | 1086 | | |
1086 | 1087 | | |
1087 | 1088 | | |
1088 | 1089 | | |
| 1090 | + | |
1089 | 1091 | | |
1090 | 1092 | | |
1091 | 1093 | | |
| |||
1296 | 1298 | | |
1297 | 1299 | | |
1298 | 1300 | | |
| 1301 | + | |
1299 | 1302 | | |
1300 | 1303 | | |
1301 | 1304 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
41 | 48 | | |
42 | 49 | | |
43 | 50 | | |
| |||
326 | 333 | | |
327 | 334 | | |
328 | 335 | | |
329 | | - | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
330 | 344 | | |
331 | 345 | | |
332 | 346 | | |
| |||
0 commit comments