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

Enabled the vec![] macro to use the [a; b] repeat syntax. #20771

Merged
merged 1 commit into from
Jan 10, 2015

Conversation

Kimundi
Copy link
Member

@Kimundi Kimundi commented Jan 8, 2015

Closes #15587

@rust-highfive
Copy link
Collaborator

r? @aturon

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton
Copy link
Member

I'm ok with this, but @aturon had worries about vec! on #20657, so I'd like to run this by him.

@aturon
Copy link
Member

aturon commented Jan 8, 2015

My worries were just about stabilizing it at all (given that we might want something more general). But that seems unlikely to land soon enough, and we should probably avoid breaking code using vec. I'm fine with this change.

@aturon
Copy link
Member

aturon commented Jan 8, 2015

Note that this is a nice replacement for from_elem.

@Kimundi
Copy link
Member Author

Kimundi commented Jan 8, 2015

Yeah, the from_elem use case is what reminded me about this. Though vec![a; b] is more restrictive since it demands a: Copy and constexpr b, but that should still cover a lot.

@nikomatsakis
Copy link
Contributor

Nifty.

bors added a commit that referenced this pull request Jan 10, 2015
Enabled the `vec![]` macro to use the `[a; b]` repeat syntax.

Reviewed-by: alexcrichton
@bors bors merged commit c163eff into rust-lang:master Jan 10, 2015
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.

vec![] should support the [value, ..repeat] syntax
6 participants