Error if an unstable const eval feature is used in a stable const fn

This commit is contained in:
Dylan MacKenzie 2020-09-02 17:11:55 -07:00
parent e4edc161f2
commit 81b3b66487
3 changed files with 33 additions and 6 deletions

View file

@ -551,7 +551,7 @@ impl Visitor<'tcx> for Validator<'mir, 'tcx> {
| TerminatorKind::DropAndReplace { place: dropped_place, .. } => {
// If we are checking live drops after drop-elaboration, don't emit duplicate
// errors here.
if super::post_drop_elaboration::checking_enabled(self.tcx) {
if super::post_drop_elaboration::checking_enabled(self.tcx, self.def_id) {
return;
}