Skip to content

Please disambiguate phrase "these traits" in 8.2.13 #983

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

Open
mcclure opened this issue Mar 17, 2021 · 0 comments
Open

Please disambiguate phrase "these traits" in 8.2.13 #983

mcclure opened this issue Mar 17, 2021 · 0 comments

Comments

@mcclure
Copy link
Contributor

mcclure commented Mar 17, 2021

I am reading the Rust reference to help me learn Rust.

I am looking at 8.2.13 "closure expressions" and I do not understand this sentence (bolded):

The compiler will determine which of the closure traits the closure's type will implement by how it acts on its captured variables. The closure will also implement Send and/or Sync if all of its captured types do. These traits allow functions to accept closures using generics, even though the exact types can't be named.

The first appearance of "closure traits" is a link to 10.1.12. I am confused whether the phase "these traits" refers to:

  • The closure traits defined in 10.1.12
  • The traits Send and Sync, defined in the previous sentence.
  • The informal English construction meaning "these characteristics…"

"Expected behavior": You should replace "These traits" with some more specific wording. My proposed alternate text for the paragraph would be (based on my current best guess at the meaning):

The compiler will determine which of the closure traits the closure's type will implement by how it acts on its captured variables. The closure will also implement the closure traits Send and/or Sync if all of its captured types do. Closure traits allow functions to accept closures using generics, even though the exact types can't be named.

I can create a PR for this change if someone can confirm that this is actually an accurate capture of the original paragraph's intent.

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

1 participant