Skip to content
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

Consider improving wording about generic functions and traits. #1035

Open
crlf0710 opened this issue Jun 3, 2021 · 1 comment
Open

Consider improving wording about generic functions and traits. #1035

crlf0710 opened this issue Jun 3, 2021 · 1 comment

Comments

@crlf0710
Copy link
Member

crlf0710 commented Jun 3, 2021

In functions.html

A generic function allows one or more parameterized types to appear in its signature. Each type parameter ...

In traits.html

Type parameters can be specified for a trait to make it generic.

These should be called generic parameters instead. Maybe just move and reference these contents to the Generic parameters chapter.

In generics.html

References, raw pointers, arrays, slices, tuples, and function pointers have lifetime or type parameters as well, but are not referred to with path syntax.

The sentences surrounding this paragraph is talking about items. And it's not really clear what this paragraph actually means...

@fee1-dead
Copy link
Member

The word "generic" is vague: It does not communicate any meaning to someone who has never heard of the term before. "Type parameters" of a function/type can be interpreted as parameters of said function/type that are types. It shouldn't be confusing, therefore I think they should always be referred as Type Parameters.

For the sentence in generics.html, I think it is talking about the parameters (T) in &'a T, *const/mut T, [T], (T, T2), etc. These are not referred to with "path syntax", i.e. turbofish as you would for functions: foo::<T>. I agree the wording of this can be improved.

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