1
Fork 0
rust/compiler/rustc_const_eval/src/transform/check_consts
bors 37f70a0e1e Auto merge of #90214 - tmiasko:indirect-mutation-qualif, r=ecstatic-morse,oli-obk
Consider indirect mutation during const qualification dataflow

Previously a local would be qualified if either one of two separate data
flow computations indicated so. First determined if a local could
contain the qualif, but ignored any forms of indirect mutation. Second
determined if a local could be mutably borrowed (and so indirectly
mutated), but which in turn ignored the qualif.

The end result was incorrect because the effect of indirect mutation was
effectivelly ignored in the all but the final stage of computation.

In the new implementation the indirect mutation is directly incorporated
into the qualif data flow. The local variable becomes immediately
qualified once it is mutably borrowed and borrowed place type can
contain the qualif.

In general we will now reject additional programs, program that were
prevously unintentionally accepted.

There are also some cases which are now accepted but were previously
rejected, because previous implementation didn't consider whether
borrowed place could have the qualif under the consideration.

Fixes #90124.

r? `@ecstatic-morse`
2021-10-29 08:38:39 +00:00
..
check.rs Auto merge of #90214 - tmiasko:indirect-mutation-qualif, r=ecstatic-morse,oli-obk 2021-10-29 08:38:39 +00:00
mod.rs Clean up special function const checks 2021-10-25 17:32:01 +01:00
ops.rs Rollup merge of #89482 - hkmatsumoto:patch-diagnostics, r=joshtriplett 2021-10-04 23:56:23 -07:00
post_drop_elaboration.rs Rename needs_drop to needs_non_const_drop 2021-10-18 20:51:22 +02:00
qualifs.rs Auto merge of #90104 - spastorino:coherence-for-negative-trait, r=nikomatsakis 2021-10-23 12:51:15 +00:00
resolver.rs Consider indirect mutation during const qualification dataflow 2021-10-26 08:20:01 +02:00