The design for impl trait has been defined by a number of RFCs and decisions. This repository represents the "accumulated state" of all these RFCs, and also includes drafts of new RFCs that are in the works. Sometimes, though, it is useful to return to an RFC to see the details. Here is a comprehensive listing of the impl trait RFCs along with some of the core ideas they describe. Please keep in mind that details of the implementation or design may have been amended since the RFC was accepted, however.
- RFC 1522: Proposed
-> impl Traitnotation in return position for free functions and inherent methods, inclued how auto traits "leak" through impl Trait.
- RFC 1951: Proposed argument position impl trait with a uniform syntax for input vs output role. Defined the capture rules regarding which generic parameters are in scope for return position impl trait.
- RFC 2071: Proposed "type alias impl trait" and defined the core idea of a hidden type that is inferred from multiple functions. Established the principle that each of those functions should independently define the full hidden type. Also introduced the ability to have
impl Traitin let, const, and static bindings. The syntax at the time was
existential type, later revised by RFC 2515.
- RFC 2515: Revised the syntax from
existential type Foo: Traitto
type Foo = impl Trait.