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

Allow CompilerControllers to access rustc_plugin::registry::Registry #36240

Merged
merged 1 commit into from
Sep 5, 2016
Merged

Allow CompilerControllers to access rustc_plugin::registry::Registry #36240

merged 1 commit into from
Sep 5, 2016

Conversation

leeopop
Copy link
Contributor

@leeopop leeopop commented Sep 3, 2016

fixes #36064

I chose to put ructc_plugin::registry::Registry structure
into CompilerState structure, instead of Session structure.
This will preserve dependencies among librustc, libructc_driver, and libructc_plugin.

@jseyfried @sanxiyn

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nikomatsakis (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.

@@ -97,7 +97,7 @@ pub fn compile_input(sess: &Session,
}
};

let krate = {
let (krate,registry) = {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: there should be a space after the comma

@jseyfried
Copy link
Contributor

jseyfried commented Sep 3, 2016

@leeopop Looks good to me modulo comments.

n.b. If you add "fixes #36064" to your initial comment (#36240 (comment)), #36064 will be closed automatically when this PR lands.

@leeopop
Copy link
Contributor Author

leeopop commented Sep 3, 2016

Thanks for your comments. I just applied them.

@leeopop
Copy link
Contributor Author

leeopop commented Sep 4, 2016

r? @jseyfried

@@ -379,6 +381,9 @@ impl<'a, 'b, 'ast, 'tcx> CompileState<'a, 'b, 'ast, 'tcx> {
cstore: &'a CStore)
-> CompileState<'a, 'b, 'ast, 'tcx> {
CompileState {
//Registry initialization should go before the krate initialization
//because krate: Some(krate) needs move.
Copy link
Contributor

Choose a reason for hiding this comment

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

formatting nit: there should be a space following //, e.g. // Registry initialization ....

Copy link
Contributor

@jseyfried jseyfried Sep 4, 2016

Choose a reason for hiding this comment

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

I don't think this comment is needed, though -- if someone tries to move krate: Some(krate) above registry: ... for some reason, they'll get the same error you got.

Copy link
Contributor

Choose a reason for hiding this comment

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

or if you want a comment, I would write it: // Initialize the registry before moving krate``.

@jseyfried
Copy link
Contributor

@leeopop r=me with formatting nit addressed.
Could you rebase and squash so that this PR consists of a single commit?

@leeopop
Copy link
Contributor Author

leeopop commented Sep 4, 2016

r= @jseyfried
I just fixed the comment, and squashed my commits.

@jseyfried
Copy link
Contributor

@leeopop Great, thanks!
@bors r+

@bors
Copy link
Contributor

bors commented Sep 4, 2016

📌 Commit ca5dfd0 has been approved by jseyfried

@bors
Copy link
Contributor

bors commented Sep 5, 2016

⌛ Testing commit ca5dfd0 with merge 86995dc...

bors added a commit that referenced this pull request Sep 5, 2016
Allow CompilerControllers to access rustc_plugin::registry::Registry

fixes #36064

I chose to put ructc_plugin::registry::Registry structure
into CompilerState structure, instead of Session structure.
This will preserve dependencies among librustc, libructc_driver, and libructc_plugin.

@jseyfried @sanxiyn
@bors bors merged commit ca5dfd0 into rust-lang:master Sep 5, 2016
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.

Access to "rustc_plugin::Registry" for CompilerControllers
5 participants