Skip to content

Commit 908dcb8

Browse files
Control whether a Qualif is cleared on move
1 parent 3758e38 commit 908dcb8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/librustc_mir/transform/check_consts/qualifs.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ impl QualifSet {
2525
pub trait Qualif {
2626
const IDX: usize;
2727

28+
/// Whether this `Qualif` is cleared when a local is moved from.
29+
const IS_CLEARED_ON_MOVE: bool = false;
30+
2831
/// Return the qualification that is (conservatively) correct for any value
2932
/// of the type, or `None` if the qualification is not value/type-based.
3033
fn in_any_value_of_ty(_cx: &ConstCx<'_, 'tcx>, _ty: Ty<'tcx>) -> Option<bool> {
@@ -256,6 +259,7 @@ pub struct NeedsDrop;
256259

257260
impl Qualif for NeedsDrop {
258261
const IDX: usize = 1;
262+
const IS_CLEARED_ON_MOVE: bool = true;
259263

260264
fn in_any_value_of_ty(cx: &ConstCx<'_, 'tcx>, ty: Ty<'tcx>) -> Option<bool> {
261265
Some(ty.needs_drop(cx.tcx, cx.param_env))

0 commit comments

Comments
 (0)