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

Fixes #7377 #7443

Merged
merged 1 commit into from
Jul 1, 2013
Merged

Fixes #7377 #7443

merged 1 commit into from
Jul 1, 2013

Conversation

yjh0502
Copy link
Contributor

@yjh0502 yjh0502 commented Jun 28, 2013

Check if there is duplicated field names in struct.

@yjh0502
Copy link
Contributor Author

yjh0502 commented Jun 29, 2013

Because of forced update, previous comment is gone. Sorry. I added a test case which I forgot to add.

I tried to change @str/@struct_field to &str/&struct_field, but because of lifetime issue, there is no easy way to change it.

@@ -3886,6 +3886,27 @@ impl Resolver {
generics: &Generics,
fields: &[@struct_field],
visitor: ResolveVisitor) {
let mut ident_str_map = HashMap::new::<@str, @struct_field>();
Copy link
Member

Choose a reason for hiding this comment

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

Can this be HashMap::new::<ast::ident, @struct_field>(), to avoid the .str_of call? (If two strings are equal, then their idents are equal too.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed @str to @ast::ident. Thanks for comment!

bors added a commit that referenced this pull request Jul 1, 2013
Check if there is duplicated field names in struct.
@bors bors closed this Jul 1, 2013
@bors bors merged commit 7bcde87 into rust-lang:master Jul 1, 2013
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