mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
6cb13585d0
Require impl Trait in associated types to appear in method signatures This implements the limited version of TAIT that was proposed in https://github.com/rust-lang/rust/issues/107645#issuecomment-1477899536 Similar to `impl Trait` in return types, `impl Trait` in associated types may only be used within the impl block which it is a part of. To make everything simpler and forward compatible to getting desugared to a plain type alias impl trait in the future, we're requiring that any associated functions or constants that want to register hidden types must be using the associated type in their signature (type of the constant or argument/return type of the associated method. Where bounds mentioning the associated type are ignored). We have preexisting tests checking that this works transitively across multiple associated types in situations like ```rust impl Foo for Bar { type A = impl Trait; type B = impl Iterator<Item = Self::A>; fn foo() -> Self::B { ...... } } ``` |
||
---|---|---|
.. | ||
bootstrap | ||
ci | ||
doc | ||
etc | ||
librustdoc | ||
llvm-project@ea6fa9c2d4 | ||
rustdoc-json-types | ||
tools | ||
README.md | ||
stage0.json | ||
version |
This directory contains some source code for the Rust project, including:
- The bootstrapping build system
- Various submodules for tools, like cargo, tidy, etc.
For more information on how various parts of the compiler work, see the rustc dev guide.