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.
Patrick
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev