On Wed, Jul 10, 2013 at 6:38 PM, Daniel Micay <[email protected]> wrote: > On Wed, Jul 10, 2013 at 5:59 PM, Patrick Walton <[email protected]> wrote: >> Hi everyone, >> >> Currently there's a problem with repeated vector expressions (`[0, ..n]`): >> the value must be copyable. I would like to change this to implicit >> copyability changing as part of the migration to `Clone`, which makes this >> even more restrictive. >> >> This makes it impossible (without writing a very long literal) to have >> something reasonable like `[None, ..4096]` with the value as `Option<~T>`, >> since `Option<~T>` is not implicitly copyable. >> >> The easiest way that I can see to fix this is to treat `EXPR` in `[EXPR, >> ..COUNT]` as evaluated once for each `COUNT`. Essentially it becomes a >> thunk. This makes me slightly nervous, but I don't see anything wrong with >> it semantically. >> >> Thoughts? >> >> Patrick > > How about we start by allowing the subset of expressions that are > constant expressions? I think it would be a reasonable limitation.
Actually, I guess that doesn't matter if we're using `Clone`... but how would it work in constants? _______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
