-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Don't mark borrows of zero-sized arrays as indirectly mutable #64967
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
This is needed to dump graphviz results for the `IndirectlyMutableLocals` analysis.
We should try to merge some form of this quickly, since #64945 seems like something that will be encountered by many nightly users. However, this may not be the best solution long-term. As a result of this PR, a mutable borrow of a zero-sized array ( |
Please also add a regression test (for the |
Okay, I added some tests that are equivalent to #64945 but also test the code with a double reference, in a static and outside a generic context. All four of the variants ICE on the current nightly (you can copy each into the playground to verify this). The double reference fix works because |
@bors r+ |
📌 Commit 7a65fe3 has been approved by |
Don't mark borrows of zero-sized arrays as indirectly mutable Resolves rust-lang#64945 r? @oli-obk
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
@bors r- |
This also tests that `&&[]` no longer causes an ICE in this PR (although the test fails the borrow checker). This could be more complete.
7a65fe3
to
4eeedd0
Compare
@Centril this now includes the |
Thanks; let's wait for the PR builder to be happy also. :) |
But it works fine on my machine! 😆 |
@bors r+ |
📌 Commit 4eeedd0 has been approved by |
Don't mark borrows of zero-sized arrays as indirectly mutable Resolves rust-lang#64945 r? @oli-obk
Rollup of 13 pull requests Successful merges: - #64581 (Fix unreachable_code warnings for try{} block ok-wrapped expressions) - #64850 (Remove inlines from DepNode code) - #64914 (regression test for 64453 borrow check error.) - #64922 (Use PlaceBuilder to avoid a lot of slice -> vec -> slice convertions) - #64948 (Improve sidebar styling to make its integration easier) - #64961 (Make comment about dummy type a bit more clear) - #64967 (Don't mark borrows of zero-sized arrays as indirectly mutable) - #64973 (Fix typo while setting `compile-flags` in test) - #64980 (Enable support for `IndirectlyMutableLocals` in `rustc_peek` ) - #64989 (Fix ICE #64964) - #64991 ([const-prop] Correctly handle locals that can't be propagated) - #64995 (Remove rustdoc warning) - #64997 (rustc book: nitpick SLP vectorization) Failed merges: r? @ghost
Resolves #64945
r? @oli-obk