Single-element vec / str append.

6dfdb83
Opened by Graydon Hoare at 2020-02-29 21:23:10

This might involve digging in the typechecker a bit; it'd be good for these to work:

let vec[T] v = ...; let T t = ...; v += t;

and

let str s = "hi"; s += 'x';

At the moment both the typechecker and the backend prefer to think of operator

  • as only applying to identical-typed values. Which is usually good. This is just an exceptional case that might be good to provide support for.

For the time being we can fake it using a single-element temporary vec or a single-char string. It's just kinda lame. But this is a lower-priority bug.

  1. Is there any way at the moment to convert a char or sequence of u8s to a str? Without that, which this bug or an explicit cast would provide, string manipulation becomes pretty hard. For the u8->str conversion, we'll probably want an is_valid_utf8 constraint.

    Jeffrey Yasskin at 2010-07-24 22:03:43

  2. Support single-element append on vec, str. Closed by ddd8feea31c7b40edbfd8552cbf763032732e358.

    Graydon Hoare at 2010-08-20 17:03:39

  3. Closed by ddd8feea31c7b40edbfd8552cbf763032732e358.

    Graydon Hoare at 2010-08-24 22:11:34

  4. error[E0658]: the #[non_exhaustive] attribute is an experimental feature --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/chrome-devtools-rs-0 .0.0-alpha.0/src/domain/runtime/event/mod.rs:12:1 | 12 | #[non_exhaustive] | ^^^^^^^^^^^^^^^^^ | = note: for more information, see https://github.com/rust-lang/rust/issues/44 109

    error[E0658]: the #[non_exhaustive] attribute is an experimental feature --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/chrome-devtools-rs-0 .0.0-alpha.0/src/domain/runtime/method/mod.rs:15:1 | 15 | #[non_exhaustive] | ^^^^^^^^^^^^^^^^^ | = note: for more information, see https://github.com/rust-lang/rust/issues/44 109

    error[E0658]: the #[non_exhaustive] attribute is an experimental feature --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/chrome-devtools-rs-0 .0.0-alpha.0/src/domain/runtime/method/mod.rs:33:1 | 33 | #[non_exhaustive] | ^^^^^^^^^^^^^^^^^ | = note: for more information, see https://github.com/rust-lang/rust/issues/44 109

    error[E0658]: the #[non_exhaustive] attribute is an experimental feature --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/chrome-devtools-rs-0 .0.0-alpha.0/src/domain/mod.rs:15:1 | 15 | #[non_exhaustive] | ^^^^^^^^^^^^^^^^^ | = note: for more information, see https://github.com/rust-lang/rust/issues/44 109

    error: aborting due to 4 previous errors

    For more information about this error, try rustc --explain E0658. error: failed to compile wrangler v1.8.0, intermediate artifacts can be found at /tmp/cargo-installZ5X1eK

    Caused by: could not compile chrome-devtools-rs.

    Can't install Cloudflare Wrangler on Ubuntu.

    justin hook at 2020-02-29 21:23:10