On 04/15/2014 10:12 AM, Patrick Walton wrote:
Hi everyone,

I'd like to remove the `~"foo"` literal syntax for owned strings in both
expressions and patterns. After dynamically sized types, this syntax is
the last remnant of the strange parser behavior by which the parser does
something different for `~"foo"` and `~("foo")` (i.e. by which it looks
at the next token when it sees a sigil and does something different than
it would otherwise).

The new replacement for `~"foo"` will be `"foo".to_owned()`. You can
also use the `fmt!()` macro or the `.to_str()` function. Post-DST, you
will likely also be able to write `Heap::from("foo")`.

This has no effect on constants since `~"foo"` is not allowed there anyway.


Thanks, Patrick. Full steam ahead. Let's get DST done.

_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to