Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upStabilize feature(match_beginning_vert) #47947
Conversation
rust-highfive
assigned
petrochenkov
Feb 1, 2018
This comment has been minimized.
This comment has been minimized.
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @petrochenkov (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
goodmanjonathan
referenced this pull request
Feb 1, 2018
Merged
Add match expression syntax and document feature(match_beginning_vert) #231
This comment has been minimized.
This comment has been minimized.
|
@bors r+ |
This comment has been minimized.
This comment has been minimized.
|
|
petrochenkov
added
the
S-waiting-on-bors
label
Feb 1, 2018
kennytm
added
the
relnotes
label
Feb 2, 2018
This comment has been minimized.
This comment has been minimized.
|
@bors rollup |
kennytm
added a commit
to kennytm/rust
that referenced
this pull request
Feb 3, 2018
bors
added a commit
that referenced
this pull request
Feb 3, 2018
kennytm
added a commit
to kennytm/rust
that referenced
this pull request
Feb 4, 2018
bors
added a commit
that referenced
this pull request
Feb 4, 2018
kennytm
added a commit
to kennytm/rust
that referenced
this pull request
Feb 4, 2018
bors
added a commit
that referenced
this pull request
Feb 4, 2018
bors
added a commit
that referenced
this pull request
Feb 4, 2018
bors
merged commit a99b5db
into
rust-lang:master
Feb 5, 2018
1 check passed
goodmanjonathan
deleted the
goodmanjonathan:stabilize_match_beginning_vert
branch
Feb 5, 2018
This comment has been minimized.
This comment has been minimized.
|
RFC had 37 downvotes compared to 19 upvotes. Not obviously a good thing to be added to the language. |
rusterize
referenced this pull request
Feb 17, 2018
Closed
rustfmt deletes vertical bar for match branches! #2462
topecongiro
referenced this pull request
Feb 18, 2018
Closed
Bring back beginning_vert field to ast::Arm #48313
This comment has been minimized.
This comment has been minimized.
warlord500
commented
Mar 25, 2018
|
I am very much against this being added to the language. it will lead to more confusing code! |
Undin
added a commit
to intellij-rust/intellij-rust
that referenced
this pull request
Mar 26, 2018
Undin
added a commit
to intellij-rust/intellij-rust
that referenced
this pull request
Mar 26, 2018
This comment has been minimized.
This comment has been minimized.
|
Same here. But nobody cares despite
|
pravic
referenced this pull request
Mar 27, 2018
Closed
Tracking issue for RFC 1925: Allow an optional vert at the beginning of a match branch #44101
This comment has been minimized.
This comment has been minimized.
warlord500
commented
Mar 29, 2018
|
this will be the one feature I will hugely disagree with in rust! unless their is extremely (strong willed) segment of developers that do like this. every example, I have been able to look at Involving, I find more confusing than with out the leading vertical bar! Not only that, but I have to yet to find strong evidence of many people wanting this feature! yes, there could be an example, but to the best of my knowledge, (which to be honest Isnt a lot) most code with this syntax added leads to more confusing code! |
This comment has been minimized.
This comment has been minimized.
|
For the record, while I don't have any idea how many people support this syntax, I do. I think F# uses vertical bars for |
This comment has been minimized.
This comment has been minimized.
|
The problem is not with the leading bar itself, the problem is that Rust now has two syntaxes to express the same thing. F# supports only leading bars. If Rust deprecated syntax without leading bars, that would probably be OK. |
This comment has been minimized.
This comment has been minimized.
tdbgamer
commented
Mar 29, 2018
|
Yeah all the arguments behind this RFC make no sense to me. There were alternatives that worked already and looked just as good. "I got used to it in F# and now I want it in Rust" is a bit of a strange argument to me. Rust shouldn't be some Frankenstein's monster of parts of different languages. Ideas should be evaluated based on their merit, and the value this brings to the table is very questionable to me. As for all the people arguing for flexible syntax and allowing different styles... This is how languages like Perl happened. "There is more than one way to do it" isn't a good thing; it's confusing and fragments the language. To quote Tim Peters "There should be one-- and preferably only one --obvious way to do it." Maybe this particular change is alright, but I just think a lot of the arguments made in this RFC are very dangerous and might lead Rust down the path many other failed languages have taken. Let's learn from their mistakes rather than repeat them because I really want Rust to succeed. There should be very strong arguments before we bloat the language spec more with little changes that have very minimal benefit to users and just add more mental overhead for beginners. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Gedweb
commented
Mar 30, 2018
|
Rust going to hell. We won't add C like increment, but this feature is OK. WAT? |
bors bot
added a commit
to intellij-rust/intellij-rust
that referenced
this pull request
Mar 31, 2018
Undin
added a commit
to intellij-rust/intellij-rust
that referenced
this pull request
Mar 31, 2018
This comment has been minimized.
This comment has been minimized.
valeth
commented
Apr 6, 2018
•
|
This looks pretty useless to me, because you can't match (for me) obvious patterns like this: let something = Some(1);
match something {
| None
| Some(x) => println!("something = {}", x)
};Rust complains that the let something = Some(1);
match something {
| None => (),
| Some(x) => println!("something = {}", x)
};Maybe I'm misunderstanding the feature, and there is a way to match such a pattern? |
This comment was marked as off-topic.
This comment was marked as off-topic.
H2CO3
commented
Apr 12, 2018
|
This is deeply worrying. Many users have expressed their concerns with this feature — they have been ignored and this feature, which adds more syntactic clutter, has been stabilized. Where did democracy go? |
This comment was marked as off-topic.
This comment was marked as off-topic.
|
FWIW: RFC1925 was awarded the Most-Disliked RFC! https://www.reddit.com/r/rust/comments/8ck0yv/rfc1925_is_awarded_the_mostdisliked_rfc/ |
This comment has been minimized.
This comment has been minimized.
valeth
commented
Apr 20, 2018
|
Not really against having something similar to Haskell's guard statements. |
This comment has been minimized.
This comment has been minimized.
|
@valeth no one ever seems to have answered your question, but your comment seems a bit confused about the scope of this stabilization. Rust has had the ability to match multiple patterns with a single arm since before 1.0. there's no way to do what you suggest in your post, because This change was strictly syntactical: it makes |
This comment has been minimized.
This comment has been minimized.
Arcaelyx
commented
Jul 11, 2018
|
This seems like such a useless pattern to add if it provides no extra functionality. In the end, things like this lead to people wanting their own style thrown in to vastly complicate the language without providing any extra practical benefit. Such as:
Whereas the difference with this is that it at least provides some benefit, but we start spiraling out of control with adding in features like this. |
goodmanjonathan commentedFeb 1, 2018
•
edited
With this feature stabilized, match expressions can optionally have a
|at the beginning of each arm.Reference PR: rust-lang-nursery/reference#231
Closes #44101