Tracking issue for #![feature(const_precise_live_drops)]
#73255
Description
This is a tracking issue for a more precise version of checking for drops in const
contexts.
The feature gate for the issue is #![feature(const_precise_live_drops)]
.
With this feature enabled, drops are checked on slightly elaborated MIR. This makes the analysis that prevents dropping in const fn
more accurate for code that does not actually drop anything: specifically, if the initial MIR contains an unnecessary call to drop
that may be eliminated in elaboration, it can be accepted with const_precise_live_drops
.
Internally, the library can also use this on a per-function basis with #[rustc_allow_const_fn_unstable(const_precise_live_drops)]
.
About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Discussion comments will get marked as off-topic or deleted.
Repeated discussions on the tracking issue may lead to the tracking issue getting locked.
Steps
- implementation: Check for live drops in constants after drop elaboration #71824
Blockers and Concerns:
- Values that need to be dropped are promoted in const / static initializers #91009
- Changes to what exact elaboration occurs may change what we accept
- (per Ralf on Zulip): ideally this would run on the same MIR and with the same logic as borrowck, but that is hard.
Activity