-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Remove const_in_array_repeat #80404
Remove const_in_array_repeat #80404
Conversation
r? @lcnr (rust-highfive has picked a reviewer for you, use r? to override) |
this looks fine to me though I am kind of surprised that this error wasn't hit more frequently as borrowck uses As I don't fully understand that I will leave the final review to someone else. maybe r? @ecstatic-morse |
r? @oli-obk (ecstatic-morse is no longer doing reviews) |
I also looked at this issue before noticing that it has PR opened already. As far as I understand, when originally written this code was working only with MIR before promotion so assertion was always true. Subsequently the code was reused to check whether My first impression regarding fixing it was to simply return false for promoteds, since they haven't been disqualified earlier. |
cc @RalfJung we could also just delete the |
@oli-obk you mean together with this problem? ;) Fine for me. The assertion here could still be helpful to catch accidentally created nested promoteds. |
yea, I don't want to remove the assertion, so let's go with removing |
Should I change this PR or should I close this for someone else's implementation? |
If you have the time and motivation to do it, the job's all yours. Feel free to do it in this PR. |
The job Click to see the possible cause of the failure (guessed by this bot)
|
The job Click to see the possible cause of the failure (guessed by this bot)
|
you need to move your new test into a test subfolder. it's also very likey that you need to bless some tests and change or remove some tests that use the |
src/test/ui/consts/rfc-2203-const-array-repeat-exprs/fn-call-in-const.rs
Show resolved
Hide resolved
📌 Commit bc653d60f640bb3ddfd905dba038ec8884026d52 has been approved by |
@bors r- |
Thanks. :) |
📌 Commit 6946534 has been approved by |
…as-schievink Rollup of 11 pull requests Successful merges: - rust-lang#80092 (2229: Fix issues with move closures and mutability) - rust-lang#80404 (Remove const_in_array_repeat) - rust-lang#81255 (Don't link with --export-dynamic on wasm32-wasi) - rust-lang#81480 (Add suggestion for nested fields) - rust-lang#81549 (Misc ip documentation fixes) - rust-lang#81566 (Add a test for rust-lang#71202) - rust-lang#81568 (Fix an old FIXME in redundant paren lint) - rust-lang#81571 (Fix typo in E0759) - rust-lang#81572 (Edit multiple error code Markdown files) - rust-lang#81589 (Fix small typo in string.rs) - rust-lang#81590 (Stabilize int_bits_const) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
The `const_in_array_repeat_expressions` feature has been removed from Rust [rust-lang/rust #80404](rust-lang/rust#80404). Signed-off-by: Akira Moroo <retrage01@gmail.com>
The `const_in_array_repeat_expressions` feature has been removed from Rust [rust-lang/rust #80404](rust-lang/rust#80404). Signed-off-by: Akira Moroo <retrage01@gmail.com>
The `const_in_array_repeat_expressions` feature has been removed from Rust [rust-lang/rust #80404](rust-lang/rust#80404). Signed-off-by: Akira Moroo <retrage01@gmail.com>
The `const_in_array_repeat_expressions` feature has been removed from Rust [rust-lang/rust #80404](rust-lang/rust#80404). Signed-off-by: Akira Moroo <retrage01@gmail.com>
Fixes #80371. Fixes #81315. Fixes #80767. Fixes #75682.
I thought there might be some issue with
Repeats(_, 0)
, but if you increase the items in the array it still ICEs. I'm not sure if this is the best fix but it does fix the given issue.