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

Mention type placeholders in the manual and tutorial #12891

Closed
Kimundi opened this issue Mar 14, 2014 · 2 comments · Fixed by #22293
Closed

Mention type placeholders in the manual and tutorial #12891

Kimundi opened this issue Mar 14, 2014 · 2 comments · Fixed by #22293

Comments

@Kimundi
Copy link
Member

Kimundi commented Mar 14, 2014

#12764 landed, but didn't include docs for the feature.

The manual and tutorial should mention it in the context of type inference, and give a proper explanation:

  • _ in a type is a "type placeholder" and has the meaning "infer this type".
  • Type placeholders are not allowed in item signatures, because global inference is not allowed by design.
  • Patterns like Vec<_> are called "partial type hints" and are useful in combination with things like collect() on iterators.
@steveklabnik
Copy link
Member

The manual should have this, but I don't want to add it to the Guide.

@steveklabnik
Copy link
Member

I want to do this, but I'm not sure where it fits in the Reference...

steveklabnik added a commit to steveklabnik/rust that referenced this issue Feb 13, 2015
Manishearth added a commit to Manishearth/rust that referenced this issue Feb 15, 2015
matthiaskrgr pushed a commit to matthiaskrgr/rust that referenced this issue Aug 2, 2022
Use large stack on expander thread

I have verified that this fixes rust-lang#12884 for me.

Hat tip to `@bjorn3` for identifying the cause of the issue.
flip1995 pushed a commit to flip1995/rust that referenced this issue Jun 13, 2024
… r=Manishearth

Fix grammer for the Safety documentation check

The original message ("unsafe function's docs miss `# Safety` section") reads quite awkwardly. I've changed it to "unsafe function's docs are missing a `# Safety` section" to have it read better.

```
changelog: [`missing_headers`]: Tweak the grammar in the lint message
```
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

Successfully merging a pull request may close this issue.

4 participants