Skip to content

Commit 8ee5e63

Browse files
committed
Placeholder docs for impl Trait
1 parent ea1240d commit 8ee5e63

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/types.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,20 @@ fn to_vec<A: Clone>(xs: &[A]) -> Vec<A> {
654654
Here, `first` has type `A`, referring to `to_vec`'s `A` type parameter; and
655655
`rest` has type `Vec<A>`, a vector with element type `A`.
656656

657+
## Abstract types
658+
659+
> Note: This section is a placeholder for more comprehensive reference
660+
> material.
661+
662+
Abstract types are types that stand in for another concrete type where the
663+
use-site may only use the trait methods declared by the trait bounds of the
664+
type.
665+
666+
Abstract types are only allowed as the type of a parameter or return type of a
667+
function except for associated functions on traits.
668+
669+
They are written as `impl` followed by a set of trait bounds.
670+
657671
## Self types
658672

659673
The special type `Self` has a meaning within traits and implementations: it

0 commit comments

Comments
 (0)