Skip to content

codegen: Generate constants names for unnamed enums in classes. #103

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

Merged
merged 1 commit into from
Oct 19, 2016

Conversation

emilio
Copy link
Contributor

@emilio emilio commented Oct 19, 2016

Fixes #84.

cc @upsuper, sorry for not doing it before, I totally forgot about it.

r? @fitzgen or @nox

Copy link
Member

@fitzgen fitzgen left a comment

Choose a reason for hiding this comment

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

LGTM!

variant_name.clone()
} else {
if parent_canonical_name.is_none() {
parent_canonical_name = Some(item.parent_id().canonical_name(ctx));
Copy link
Member

Choose a reason for hiding this comment

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

Can we eagerly initialize this to Some above the loop if !item.is_toplevel(ctx), rather than unconditionally initializing to None and repeatedly checking on every iteration?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep!, just did that :)

@emilio
Copy link
Contributor Author

emilio commented Oct 19, 2016

@bors-servo: r=fitzgen

@bors-servo
Copy link

📌 Commit fd9c1fe has been approved by fitzgen

@bors-servo
Copy link

⚡ Test exempted - status

@bors-servo bors-servo merged commit fd9c1fe into rust-lang:master Oct 19, 2016
bors-servo pushed a commit that referenced this pull request Oct 19, 2016
codegen: Generate constants names for unnamed enums in classes.

Fixes #84.

cc @upsuper, sorry for not doing it before, I totally forgot about it.

r? @fitzgen or @nox
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.

4 participants