Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single-element vec / str append. #44

Closed
graydon opened this issue Jun 22, 2010 · 4 comments
Closed

Single-element vec / str append. #44

graydon opened this issue Jun 22, 2010 · 4 comments
Labels
A-frontend Area: frontend (errors, parsing and HIR)

Comments

@graydon
Copy link
Contributor

graydon commented Jun 22, 2010

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.

@jyasskin
Copy link
Contributor

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.

@graydon
Copy link
Contributor Author

graydon commented Aug 20, 2010

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

@graydon
Copy link
Contributor Author

graydon commented Aug 24, 2010

Closed by ddd8fee.

mbrubeck pushed a commit to mbrubeck/rust that referenced this issue Oct 17, 2011
pcwalton added a commit to pcwalton/rust that referenced this issue Sep 25, 2014
This makes `FnMut` require `FnOnce` and `Fn` require `FnMut`. Therefore,
this change breaks code that implements the `FnMut` and/or `Fn` traits
directly, without also implementing their dependencies. A simple
forwarding implementation that defines `FnOnce` in terms of `FnMut`
and/or `Fn` in terms of `FnMut` will suffice.

This does not affect code that simply uses the `|&:|`/`|&mut:|`/`|:|`
unboxed closure construction notation.

Part of RFC rust-lang#44; needed to implement RFC rust-lang#63.

Part of issue rust-lang#12831.

[breaking-change]
oli-obk pushed a commit to oli-obk/rust that referenced this issue Jul 19, 2017
keeperofdakeys pushed a commit to keeperofdakeys/rust that referenced this issue Dec 12, 2017
Add a whole mess more android constants
kazcw pushed a commit to kazcw/rust that referenced this issue Oct 23, 2018
dlrobertson pushed a commit to dlrobertson/rust that referenced this issue Nov 29, 2018
Add details about integer overflow
@justinh00k
Copy link

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 #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 #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 #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 #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.

eddyb pushed a commit to eddyb/rust that referenced this issue Jun 30, 2020
bors bot referenced this issue in softdevteam/alloy Apr 29, 2021
44: Make `Gc<T>` require bounds `T: Send + Sync` r=ltratt a=jacob-hughes

The collector finalizes objects off the main thread. This means that if
any fields are accessed via T's drop method, it must be done in a
thread-safe way.

A common pattern is to allow the `Gc<T>` to hold trait objects. For this
change to work, TO methods need a `where Self: Send + Sync` clause for
the compiler to guarantee object safety. Such clauses are deprecated in
rustc because they can be used to create UB when binding to user traits
with methods. However, at the time of this commit it's the only known
way to add additional bounds for auto traits. From my understanding this
usage is considered safe until a better situation arises [1].

[1]: rust-lang#50781 (comment)

Co-authored-by: Jake Hughes <jh@jakehughes.uk>
djtech-dev pushed a commit to djtech-dev/rust that referenced this issue Dec 9, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-frontend Area: frontend (errors, parsing and HIR)
Projects
None yet
Development

No branches or pull requests

3 participants