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

Use .. consistently for ignoring multiple elements in patterns #10366

Merged
merged 2 commits into from
Nov 19, 2013

Conversation

brson
Copy link
Contributor

@brson brson commented Nov 8, 2013

This replaces * with .. in enums, _ with .. in structs, and .._ with .. in vectors. It adds obsolete syntax warnings for the old forms but doesn't turn them on yet because we need a snapshot.
#5830

@brson
Copy link
Contributor Author

brson commented Nov 8, 2013

This adds a new pattern type PatWildMult, specifically for slice wildcards, but almost all the cases where it appears end up exactly the same as PatWild.

let subpat = self.parse_pat();
match subpat {
@ast::Pat { id, node: PatWild, span } => {
// FIXME #5830 activate after snapshot
Copy link
Member

Choose a reason for hiding this comment

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

Could you change this to a NOTE? At least when I've made a snapshot I normally run make tidy to see how much there's left to do (other than git grep stage0)

@alexcrichton
Copy link
Member

In the test you added, all the old syntax is going away, right? If so, r=me with NOTEs instead of FIXMEs

@brendanzab
Copy link
Member

and .._ with .. in vectors

@brson can you still do the tail destructuring? ie. [hd, ..tl]?

@brson
Copy link
Contributor Author

brson commented Nov 11, 2013

@bjz Yes.

@brson
Copy link
Contributor Author

brson commented Nov 11, 2013

@alexcrichton Yeah, the old syntax is going away. I just threw it all in there to see it all in the same place.

bors added a commit that referenced this pull request Nov 19, 2013
This replaces `*` with `..` in enums, `_` with `..` in structs, and `.._` with `..` in vectors. It adds obsolete syntax warnings for the old forms but doesn't turn them on yet because we need a snapshot.

#5830
@bors bors closed this Nov 19, 2013
@bors bors merged commit 85f107d into rust-lang:master Nov 19, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Apr 6, 2023
fix [`cast_possible_truncation`] offering wrong suggestion for casting float to integer

fixes: rust-lang#10366

---

changelog: [`cast_possible_truncation`] Fix incorrect suggestions when casting from float types or to `_`
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.

4 participants