Skip to content

Improve the vec![...] macro with UFCS. #21354

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
Jan 22, 2015
Merged

Conversation

eddyb
Copy link
Member

@eddyb eddyb commented Jan 18, 2015

There are two limitations to the macro that this addresses:

  1. the expected type is not propagated, coercions don't trigger
  2. references inside element expressions don't outlive the Vec

Both of these limitations are caused by the block in the
macro expansion, previously needed to trigger a coercion
from Box<[T; N]> to Box<[T]>, now possible with UFCS.

There are two limitations to the macro that this addresses:
1. the expected type is not propagated, coercions don't trigger
2. references inside element expressions don't outlive the `Vec`

Both of these limitations are caused by the block in the
macro expansion, previously needed to trigger a coercion
from `Box<[T; N]>` to `Box<[T]>`, now possible with UFCS.
@rust-highfive
Copy link
Contributor

r? @alexcrichton

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

@alexcrichton
Copy link
Member

@bors: r+ 23a553a

@bors
Copy link
Collaborator

bors commented Jan 20, 2015

⌛ Testing commit 23a553a with merge bfd11fd...

@eddyb
Copy link
Member Author

eddyb commented Jan 20, 2015

@bors retry :(

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Jan 21, 2015
There are two limitations to the macro that this addresses:
1. the expected type is not propagated, coercions don't trigger
2. references inside element expressions don't outlive the `Vec`

Both of these limitations are caused by the block in the
macro expansion, previously needed to trigger a coercion
from `Box<[T; N]>` to `Box<[T]>`, now possible with UFCS.
@alexcrichton
Copy link
Member

@bors: retry

@bors bors merged commit 23a553a into rust-lang:master Jan 22, 2015
@eddyb eddyb deleted the vec-ufcs branch January 22, 2015 09:16
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