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

Move syntax::ext to a syntax_expand and refactor some attribute logic #65465

Merged
merged 15 commits into from
Oct 17, 2019

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Oct 16, 2019

Part of #65324.

r? @petrochenkov

@rust-highfive

This comment has been minimized.

@JohnTitor JohnTitor added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 16, 2019
@@ -10,13 +10,14 @@
#![feature(plugin_registrar, rustc_private)]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe let's remove these tests? They are pretty annoying...

Copy link
Contributor

Choose a reason for hiding this comment

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

These are smoke tests for syntactic plugins, the only thing making sure that they don't break.
I think they should exist until we remove the plugins themselves.

@@ -18,7 +18,7 @@ use syntax::parse::new_parser_from_source_str;
use syntax::parse::parser::Parser;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Shouldn't this be a normal ui test?

Copy link
Contributor

Choose a reason for hiding this comment

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

AFAIK, anything depending on compiler crates has to be a fulldeps test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, what I wonder tho if this test could not be expressed as a series of UI tests instead -- the structure seems to be just ordinary compile-pass / compile-fail wrt. "reject" and "check". Using cfg(FALSE) it seems to me we can migrate this test to use that instead and privatize some stuff in the process.

Copy link
Contributor

@petrochenkov petrochenkov Oct 16, 2019

Choose a reason for hiding this comment

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

Ah, you mean rewriting the test entirely to test snippets inside fn run() using the usual UI approach instead of libsyntax APIs.
If it's possible to do, then it would be great.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, the test can be made a unit test inside libsyntax, if privacy of libsyntax APIs is an issue.

@rust-highfive

This comment has been minimized.

@petrochenkov
Copy link
Contributor

r=me with fulldeps tests updated.

@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 16, 2019
@rust-highfive

This comment has been minimized.

@rust-highfive

This comment has been minimized.

@Centril
Copy link
Contributor Author

Centril commented Oct 16, 2019

@bors r=petrochenkov

@bors
Copy link
Contributor

bors commented Oct 16, 2019

📌 Commit 8ca16dd has been approved by petrochenkov

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 16, 2019
Centril added a commit to Centril/rust that referenced this pull request Oct 16, 2019
Move syntax::ext to a syntax_expand and refactor some attribute logic

Part of rust-lang#65324.

r? @petrochenkov
Centril added a commit to Centril/rust that referenced this pull request Oct 16, 2019
Move syntax::ext to a syntax_expand and refactor some attribute logic

Part of rust-lang#65324.

r? @petrochenkov
bors added a commit that referenced this pull request Oct 17, 2019
Rollup of 8 pull requests

Successful merges:

 - #65094 (Prefer statx on linux if available)
 - #65316 (make File::try_clone produce non-inheritable handles on Windows)
 - #65319 (InterpCx: make memory field public)
 - #65461 (Don't recommend ONCE_INIT in std::sync::Once)
 - #65465 (Move syntax::ext to a syntax_expand and refactor some attribute logic)
 - #65469 (Update libc to 0.2.64)
 - #65475 (add example for type_name)
 - #65478 (fmt::Write is about string slices, not byte slices)

Failed merges:

r? @ghost
Centril added a commit to Centril/rust that referenced this pull request Oct 17, 2019
Move syntax::ext to a syntax_expand and refactor some attribute logic

Part of rust-lang#65324.

r? @petrochenkov
bors added a commit that referenced this pull request Oct 17, 2019
Rollup of 8 pull requests

Successful merges:

 - #65237 (Move debug_map assertions after check for err)
 - #65316 (make File::try_clone produce non-inheritable handles on Windows)
 - #65319 (InterpCx: make memory field public)
 - #65461 (Don't recommend ONCE_INIT in std::sync::Once)
 - #65465 (Move syntax::ext to a syntax_expand and refactor some attribute logic)
 - #65475 (add example for type_name)
 - #65478 (fmt::Write is about string slices, not byte slices)
 - #65486 (doc: fix typo in OsStrExt and OsStringExt)

Failed merges:

r? @ghost
@bors bors merged commit 8ca16dd into rust-lang:master Oct 17, 2019
@Centril Centril deleted the split-syntax-1 branch October 17, 2019 23:01
@@ -522,7 +520,7 @@ impl<'a> Parser<'a> {

/// If the next token is the given keyword, eats it and returns `true`.
/// Otherwise, returns `false`. An expectation is also added for diagnostics purposes.
pub fn eat_keyword(&mut self, kw: Symbol) -> bool {
fn eat_keyword(&mut self, kw: Symbol) -> bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

@Centril Please reconsider before making these kinds of 'refactorings.' Tools like rustfmt which rely on the libsyntax suffer severely from reduced visibility. Now I have to iterate through the changes, re-publish hidden fields and methods, make a PR and wait until it gets merged.

I understand that the libsyntax is primarily for the rustc itself, and its interface is unstable. But please be conservative about the visibility of its interface.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@topecongiro If you rely on something then there should be a comment to that effect in the rustc sources. Reducing visibility is an important tool for cleaning up the rustc internals and should be used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants