Uh oh!
There was an error while loading. Please reload this page.
Parse pub(restricted) visibilities on tuple struct fields - #33161
Conversation
pub(restricted) visibilities on tuple struct fieldsjseyfried
commented
Apr 23, 2016
Ha, I expected to implement this myself today. I'd like to see more tests for error messages for failed reinterpretation. |
Will do. Do you think there should be a different error message for failed reinterpretation?
Good point, I hadn't considered that. Will do. |
petrochenkov
commented
Apr 23, 2016
It just needs to be reasonable, I think the current one is ok. |
bors
commented
Apr 24, 2016
☔ The latest upstream changes (presumably #33179) made this pull request unmergeable. Please resolve the merge conflicts. |
0deeebf to
1bfc50bCompareThere was a problem hiding this comment.
@nikomatsakis we have this test case, but the macro id should be
#![feature(type_macros)]macro_rules! id {($t:ty) => { $t }}instead of how it is defined now.
Is this the type of test you had in mind?
There was a problem hiding this comment.
I can add more tests, but due to poor error recovery we need one test per parse error.
jseyfried
commented
Apr 25, 2016
I rebased and addressed @petrochenkov's comments. |
| let ty = p.parse_ty_sum()?; | ||
| let mut vis = p.parse_visibility(false)?; | ||
| let ty_is_interpolated = | ||
| p.token.is_interpolated() || p.look_ahead(1, |t| t.is_interpolated()); |
There was a problem hiding this comment.
Do we have any tests covering this interpolated case? I expected to see one where we substitute in a $t:ty.
It is a bit of a shame that we have no $p:path fragment specificier, though I guess rust-lang/rfcs#1575 would address the use case.
nikomatsakis
commented
Apr 27, 2016
Yes, and maybe also having |
jseyfried
commented
Apr 27, 2016
Good point, will do. |
nikomatsakis
commented
Apr 27, 2016
r=me w/ a few more tests also, @jseyfried, you can I think use the revisions mechanism if you'd prefer to have multiple errors per file. You have to add then write code with or |
nikomatsakis
commented
Apr 27, 2016
(Though maybe it doesn't work with that class of test yet) |
jseyfried
commented
Apr 27, 2016
Interesting, I'll give it a try. |
jseyfried
commented
Apr 27, 2016
The revisions mechanism won't work for parse errors since we always parse and expand unconfigured items (cf my comment in #25544). |
1bfc50b to
d2ca7d0Compared2ca7d0 to
78a8127Comparejseyfried
commented
Apr 27, 2016
@bors r=nikomatsakis |
bors
commented
Apr 27, 2016
📌 Commit 78a8127 has been approved by |
bors
commented
Apr 28, 2016
…matsakis Parse `pub(restricted)` visibilities on tuple struct fields Parse `pub(restricted)` on tuple struct fields (cc #32409). r? @nikomatsakis
Parse
pub(restricted)on tuple struct fields (cc #32409).r? @nikomatsakis