Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bzm3r opened this issue Jun 28, 2023 · 1 comment
Closed

Comments

@bzm3r
Copy link

bzm3r commented Jun 28, 2023

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.

@ehuss
Copy link
Contributor

ehuss commented Jun 28, 2023

Thanks for the report! Yea, the default type and const values aren't documented, yet, but they definitely should be. I'm going to close as a duplicate of #24 (and #1159 to some degree), since this is tracked in that issue.

@ehuss ehuss closed this as not planned Won't fix, can't repro, duplicate, stale Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants