Skip to content

Explain behavior of _ #31352

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

Merged
merged 2 commits into from
Feb 3, 2016
Merged

Explain behavior of _ #31352

merged 2 commits into from
Feb 3, 2016

Conversation

steveklabnik
Copy link
Member

Fixes #31154

@rust-highfive
Copy link
Contributor

r? @nikomatsakis

(rust_highfive has picked a reviewer for you, use r? to override)

@durka
Copy link
Contributor

durka commented Feb 2, 2016

What about temporaries being dropped?

@steveklabnik
Copy link
Member Author

That's a consequence of this behavior, I guess it does deserve its own explanation too.

println!("Tuple is: {:?}", tuple);
```

In a similar fashion to `_`, you can use `..` in a pattern to disregard
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/in a pattern/in some patterns
.. unlike _ is not an independent pattern, it's part of some other pattern's syntax

@steveklabnik
Copy link
Member Author

Updated to address both comments.

@durka
Copy link
Contributor

durka commented Feb 2, 2016

👍

@nikomatsakis
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Feb 2, 2016

📌 Commit 6c90721 has been approved by nikomatsakis

Manishearth added a commit to Manishearth/rust that referenced this pull request Feb 2, 2016
bors added a commit that referenced this pull request Feb 3, 2016
@bors bors merged commit 6c90721 into rust-lang:master Feb 3, 2016
@steveklabnik steveklabnik deleted the gh31154 branch June 19, 2016 20:30
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 this pull request may close these issues.

6 participants