This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit ab32548
committed
Auto merge of rust-lang#101224 - compiler-errors:rpitit, r=oli-obk
Initial implementation of return-position `impl Trait` in traits
* Create a new item kind, called `ImplTraitPlaceholder`, which is used to lower `ast::TyKind::ImplTrait` in trait method returns.
* This item is the child of the trait method, which simplifies the way we calculate bounds and stuff.
* Use the def-id of this type to construct a projection type that we use during astconv for the return type of the trait method signature.
* Implement logic to normalize this `ImplTraitPlaceholder` projection type when we know its concrete impl (this is pretty limited currently, but really there are no other selection candidates that make sense -- for now!)
* Check that the `impl Trait`'s bounds are satisfied on the concrete type provided in the impl.
This is obviously nowhere near complete, but I wanted to at least get some initial support landed so we can start playing around with it.
What works:
* async fn in trait and RPITIT, including multiple `impl Trait`s and `impl Trait` nested in associated type bindings, like `impl Future<Output = impl Sized>`File tree
80 files changed
+1078
-304
lines changed- compiler
- rustc_ast_lowering/src
- rustc_ast_passes/src
- rustc_ast/src
- rustc_borrowck/src/diagnostics
- rustc_error_messages/locales/en-US
- rustc_feature/src
- rustc_hir/src
- rustc_infer/src/infer/error_reporting
- nice_region_error
- rustc_metadata/src/rmeta
- rustc_middle/src
- hir/map
- query
- ty
- print
- rustc_monomorphize/src
- rustc_passes/src
- rustc_privacy/src
- rustc_resolve/src
- late
- rustc_save_analysis/src
- rustc_span/src
- rustc_trait_selection/src/traits
- rustc_ty_utils/src
- rustc_typeck/src
- astconv
- check
- collect
- src
- librustdoc
- clean
- formats
- passes
- test/ui
- async-await
- issues
- feature-gates
- impl-trait
- in-trait
- parser
- resolve
- span
- tools/clippy
- clippy_lints/src
- clippy_utils/src
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
80 files changed
+1078
-304
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2367 | 2367 | | |
2368 | 2368 | | |
2369 | 2369 | | |
2370 | | - | |
| 2370 | + | |
2371 | 2371 | | |
2372 | | - | |
| 2372 | + | |
2373 | 2373 | | |
2374 | 2374 | | |
2375 | 2375 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
334 | 334 | | |
335 | 335 | | |
336 | 336 | | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
851 | 851 | | |
852 | 852 | | |
853 | 853 | | |
854 | | - | |
| 854 | + | |
855 | 855 | | |
856 | 856 | | |
857 | 857 | | |
| |||
955 | 955 | | |
956 | 956 | | |
957 | 957 | | |
958 | | - | |
| 958 | + | |
| 959 | + | |
959 | 960 | | |
960 | 961 | | |
961 | 962 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
272 | | - | |
| 272 | + | |
273 | 273 | | |
274 | 274 | | |
275 | 275 | | |
| |||
661 | 661 | | |
662 | 662 | | |
663 | 663 | | |
664 | | - | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
665 | 671 | | |
666 | 672 | | |
667 | 673 | | |
| |||
771 | 777 | | |
772 | 778 | | |
773 | 779 | | |
| 780 | + | |
774 | 781 | | |
775 | | - | |
776 | | - | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
777 | 789 | | |
778 | 790 | | |
779 | 791 | | |
| |||
1240 | 1252 | | |
1241 | 1253 | | |
1242 | 1254 | | |
1243 | | - | |
| 1255 | + | |
1244 | 1256 | | |
1245 | 1257 | | |
1246 | 1258 | | |
1247 | 1259 | | |
1248 | | - | |
| 1260 | + | |
1249 | 1261 | | |
1250 | 1262 | | |
1251 | 1263 | | |
| |||
0 commit comments