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

Struct literal syntax allows repeated fields #3486

Closed
catamorphism opened this issue Sep 13, 2012 · 0 comments
Closed

Struct literal syntax allows repeated fields #3486

catamorphism opened this issue Sep 13, 2012 · 0 comments
Assignees
Labels
A-type-system Area: Type system
Milestone

Comments

@catamorphism
Copy link
Contributor

Right now, you can write:

T { foo: 1, foo: 2 }

if T is a struct with a foo field. (I haven't checked if this is only accepted if T has exactly two fields, but it's definitely accepted if so.) The typechecker should reject this because it duplicates a field.

@ghost ghost assigned brson Oct 31, 2012
@brson brson closed this as completed in cb4de73 Oct 31, 2012
bors pushed a commit to rust-lang-ci/rust that referenced this issue May 15, 2021
add document describing rustfmt's stabilisation process
RalfJung pushed a commit to RalfJung/rust that referenced this issue Apr 20, 2024
add test checking that we do run MIR validation

Fixes rust-lang/miri#2840
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-type-system Area: Type system
Projects
None yet
Development

No branches or pull requests

2 participants