-
Notifications
You must be signed in to change notification settings - Fork 13k
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
More flexible initialization for vectors #12680
Comments
#11936 is a sub-issue of this issue. (It does not mention about how to fill the unspecified elements.) |
Closing as a dupe of #11936. Filling in unspecified elements is required for soundness regardless of syntax/implementation. |
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Jul 25, 2022
fix regressions on assignment expressions This is a follow-up PR on rust-lang#12428. I'm not sure if this is everything I overlooked, so if there are more things that are not right, we may want to revert rust-lang#12428. This should also fix the increase of the type mismatches and the unknown types in diesel in the [metrics](https://rust-analyzer.github.io/metrics/?start=2022-06-23&end=2022-07-01) introduced by rust-lang#12428. The regressions are: - some coercions don't work in the ordinary (i.e. non-destructuring) assignments In order for coercions on ADT fields instantiations to work, lhs type has to be known before inferring rhs. rust-lang#12428 changed the inference order, making rhs inferred before lhs, breaking the coercion, so I restored the original inference mechanism for the ordinary assignments. Note that this kind of coercion doesn't happen in destructuring assigments, because when they are desugared, the struct expression is first assigned to a temporary, which is then assigned to the assignee, which is not coercion site anymore. - type mismatches on individual identifiers are not reported
flip1995
pushed a commit
to flip1995/rust
that referenced
this issue
Apr 18, 2024
…r=llogiq Add `cargo dev setup toolchain` Adds a `cargo dev setup toolchain` subcommand that creates a rustup toolchain with symlinks to the local `cargo-clippy` and `clippy-driver`. Allows you to then do `cargo +clippy clippy` in other projects to run the locally built Clippy Sometimes more convenient when you're testing changes on a separate project than `cd`ing back & forth to use `cargo dev lint [project]` changelog: none
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In one of my projects which I'd like to port to rust in the long term, there is some C99 compliant array initializer like so;
Here
opc_unident
fills the parts of the array not specified, and each[index] = val
pair putsval
at the respectiveindex
. This cuts down the boilerplate for some tasks a LOT (In rust, I would have to write out all 255 entries for it to be quickly "maintainable").I propose some syntax is added for complex initialization of vectors in a similar way.
The text was updated successfully, but these errors were encountered: