]> git.lizzy.rs Git - rust.git/commit
Improve the vec![...] macro with UFCS.
authorEduard Burtescu <edy.burt@gmail.com>
Sun, 18 Jan 2015 11:13:23 +0000 (13:13 +0200)
committerEduard Burtescu <edy.burt@gmail.com>
Sun, 18 Jan 2015 11:13:23 +0000 (13:13 +0200)
commit23a553a30398c856ae7d7179b751024334444296
treeda078a016aca52bc4e33f18146e2a63fd07ac67a
parenta833337943300db1c310a4cf9c84b7b4ef4e9468
Improve the vec![...] macro 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.
src/libcollections/macros.rs
src/test/run-pass/coerce-expect-unsized.rs
src/test/run-pass/vec-macro-rvalue-scope.rs [new file with mode: 0644]