Skip to content

Describe the = Type portion of syntax for TypeParam/ConstParam in GenericParams #1373

Closed as not planned
@bzm3r

Description

@bzm3r

Generic type/constant parameters can be written like so: <X: MyTrait = MyType>

But what does = MyType mean? This is not mentioned in the article for Generic Parameters in the Rust Reference: https://doc.rust-lang.org/reference/items/generics.html

It is however, described in the Book: https://doc.rust-lang.org/book/ch19-03-advanced-traits.html#default-generic-type-parameters-and-operator-overloading

Should the Reference include a couple of sentences that help a user know what term they ought to search for more information? For example, something like:

Generic type and constant parameters can specify a default concrete type using the <GenericType=ConcreteType> syntax.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions