The issue title says it all really. std::mem::needs_drop is a function that doesn't change from call to call once monomorphized, so it should be a const function.
EDIT:
This has been implemented and it is waiting for stabilization now.
blocked on https://github.com/rust-lang/rust/pull/51570
@oli-obk is this still blocked? If not I would like to help out with it. :+1:
Should be fine to add behind a feature gate.
The steps are basically the same as https://github.com/rust-lang/rust/pull/51171 and https://github.com/rust-lang/rust/pull/51299 (but you can do them in a single PR)
It might be nice to keeps this issue open until const_needs_drop is stabilized.
I know it's only been a few months since this was implemented, but I'm curious what the road to stabilization is. I've been using this in my objrs crate and it's been working great. At what point should I send a stabilization PR?
I've nominated this for libs team to take a look at and decide whether or not to propose FCP for stabilization.
I've added T-lang since they'd better know if this bit of const-fn-ness is ready to stabilize.
@rfcbot fcp merge
Team member @sfackler has proposed to merge this. The next step is review by the rest of the tagged team members:
No concerns currently listed.
Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!
See this document for info about what commands tagged team members can give me.
Seems unobjectionable (assuming the implementation is up to snuff...? cc @oli-obk).
Yea, the impl has baked in miri since long before it was in const eval. I also rechecked it and I see no reason not to stabilize.
馃憢 @joshtriplett @nikomatsakis @pnkfelix @withoutboats
:bell: This is now entering its final comment period, as per the review above. :bell:
The final comment period, with a disposition to merge, as per the review above, is now complete.
As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.
The RFC will be merged soon.
Most helpful comment
Yea, the impl has baked in miri since long before it was in const eval. I also rechecked it and I see no reason not to stabilize.