Skip to content

Commit 99fc3ef

Browse files
committed
rustc_mir: do not treat NEEDS_DROP as unexpected in qualify_consts.
1 parent 1d6332d commit 99fc3ef

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/librustc_mir/transform/qualify_consts.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,6 @@ bitflags::bitflags! {
4848
// Refers to temporaries which cannot be promoted as
4949
// promote_consts decided they weren't simple enough.
5050
const NOT_PROMOTABLE = 1 << 3;
51-
52-
// Const items can only have MUTABLE_INTERIOR
53-
// and NOT_PROMOTABLE without producing an error.
54-
const CONST_ERROR = !Qualif::MUTABLE_INTERIOR.bits &
55-
!Qualif::NOT_PROMOTABLE.bits;
5651
}
5752
}
5853

@@ -419,13 +414,13 @@ impl<'a, 'tcx> Qualifier<'a, 'tcx> {
419414
};
420415

421416
// Bail out on oon-`const fn` calls or if the callee had errors.
422-
if !is_const_fn || self.qualify_operand(callee).intersects(Qualif::CONST_ERROR) {
417+
if !is_const_fn || self.qualify_operand(callee).intersects(Qualif::NOT_CONST) {
423418
return Qualif::NOT_CONST;
424419
}
425420

426421
// Bail out if any arguments had errors.
427422
for arg in args {
428-
if self.qualify_operand(arg).intersects(Qualif::CONST_ERROR) {
423+
if self.qualify_operand(arg).intersects(Qualif::NOT_CONST) {
429424
return Qualif::NOT_CONST;
430425
}
431426
}
@@ -668,7 +663,7 @@ impl<'a, 'tcx> Checker<'a, 'tcx> {
668663

669664
// Account for errors in consts by using the
670665
// conservative type qualification instead.
671-
if qualif.intersects(Qualif::CONST_ERROR) {
666+
if qualif.intersects(Qualif::NOT_CONST) {
672667
qualif = self.qualifier().qualify_any_value_of_ty(mir.return_ty());
673668
}
674669

0 commit comments

Comments
 (0)