Skip to content

Commit 0361e59

Browse files
committed
use reveal_all during drop elaboration
This used to happen by default as part of the normalization routine that was being used.
1 parent 2a58875 commit 0361e59

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

src/librustc_mir/shim.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ fn build_drop_shim<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
210210

211211
if let Some(..) = ty {
212212
let patch = {
213-
let param_env = tcx.param_env(def_id);
213+
let param_env = tcx.param_env(def_id).with_reveal_all();
214214
let mut elaborator = DropShimElaborator {
215215
mir: &mir,
216216
patch: MirPatch::new(&mir),

src/librustc_mir/transform/elaborate_drops.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ impl MirPass for ElaborateDrops {
5050
(hir::BodyOwnerKind::Fn, None) => {},
5151
_ => return
5252
}
53-
let param_env = tcx.param_env(src.def_id);
53+
let param_env = tcx.param_env(src.def_id).with_reveal_all();
5454
let move_data = MoveData::gather_moves(mir, tcx).unwrap();
5555
let elaborate_patch = {
5656
let mir = &*mir;

src/librustc_mir/util/elaborate_drops.rs

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ use rustc::hir;
1313
use rustc::mir::*;
1414
use rustc::middle::const_val::ConstVal;
1515
use rustc::middle::lang_items;
16+
use rustc::traits::Reveal;
1617
use rustc::ty::{self, Ty, TyCtxt};
1718
use rustc::ty::subst::{Kind, Substs};
1819
use rustc::ty::util::IntTypeExt;
@@ -206,6 +207,7 @@ impl<'l, 'b, 'tcx, D> DropCtxt<'l, 'b, 'tcx, D>
206207
let field = Field::new(i);
207208
let subpath = self.elaborator.field_subpath(variant_path, field);
208209

210+
assert_eq!(self.elaborator.param_env().reveal, Reveal::All);
209211
let field_ty = self.tcx().normalize_erasing_regions(
210212
self.elaborator.param_env(),
211213
f.ty(self.tcx(), substs),

0 commit comments

Comments
 (0)