Uh oh!
There was an error while loading. Please reload this page.
Implement RFC 1925 - #44108
Conversation
rust-highfive
commented
Aug 26, 2017
(rust_highfive has picked a reviewer for you, use r? to override) |
There was a problem hiding this comment.
Is there a better span to use here?
I suppose used_beginning_vert could become Option<Span>...
There was a problem hiding this comment.
It should be possible to call emit_feature_err immediately from parse_arm, the precise span is available there.
In addition, changes to AST (used_beginning_vert: bool) will likely break rustfmt and you'll have to send PR to rustfmt repo as well, do submodule updates, etc, so I recommend against it.
There was a problem hiding this comment.
Oh, I didn't know that features were already available during parsing!
There was a problem hiding this comment.
I don't know if they are available as well, but it's worth trying, because the alternative is not especially pleasant.
There was a problem hiding this comment.
This needs a // gate-test-match_beginning_vert annotation, so the test is counted as a feature gate test.
There was a problem hiding this comment.
That shouldn't be necessary as long as the test is named correctly, no? That's what tidy said, and most of the other tests (ex) don't have them.
There was a problem hiding this comment.
Okay, if this passes testing, then it's good.
There was a problem hiding this comment.
This should be just
let beginning_vert = ifself.eat(&token::BinOp(token::Or)){Some(self.prev_span)}else{None};edit: Nevermind, that can work as well.
c9bb16e to
f4dc91aComparemattico
commented
Aug 27, 2017
I can't find any way to query features in the parser, and I'm pretty sure it doesn't exist. Nothing else in the parser (outside of libsyntax_ext) uses features, and the features need to be parsed! I see a few paths forward:
|
petrochenkov
commented
Aug 27, 2017
Ok, sorry for pointing the wrong way.
Not issues, just possible inconveniences with updating rustfmt and rls. |
carols10cents
commented
Aug 28, 2017
r? @arielb1 |
arielb1
commented
Aug 29, 2017
r? @petrochenkov - he's our parser guy |
arielb1
commented
Aug 29, 2017
But currently, I think a feature gate is wide-open |
There was a problem hiding this comment.
You should use sess.features.borrow().match_beginning_vert here, otherwise the feature gate won't work
There was a problem hiding this comment.
sess is a ParseSess which does not have a features field.
mattico
commented
Aug 29, 2017
@arielb1 yep! waiting for confirmation that a feature gate is necessary/desired before I reimplement it by mucking with the AST. |
petrochenkov
commented
Sep 1, 2017
Let's add a feature gate. |
mattico
commented
Sep 1, 2017
@petrochenkov sounds good, will do! |
f531b24 to
e631b8dComparemattico
commented
Sep 1, 2017
Interesting failures. Taking a look. |
mattico
commented
Sep 1, 2017
I ran a build of rustfmt, it works fine with this change. They only access single fields of Arm, so it doesn't break anything. RLS also works. Clippy was already broken before these changes. |
petrochenkov
commented
Sep 2, 2017
@bors r+ |
bors
commented
Sep 2, 2017
📌 Commit 22ca03b has been approved by |
bors
commented
Sep 2, 2017
bors
commented
Sep 3, 2017
☀️ Test successful - status-appveyor, status-travis |
cc #44101