refactor ParamEnv::empty(Reveal) into two distinct methods

- `ParamEnv::empty()` -- does not reveal all, good for typeck
- `ParamEnv::reveal_all()` -- does, good for trans
- `param_env.with_reveal_all()` -- converts an existing parameter environment
This commit is contained in:
Niko Matsakis 2018-02-10 13:18:02 -05:00
parent 1d377d10a1
commit 6d0f9319df
29 changed files with 77 additions and 72 deletions

View file

@ -199,7 +199,7 @@ impl<'a, 'b, 'tcx> Instance<'tcx> {
_ => {
if Some(def_id) == tcx.lang_items().drop_in_place_fn() {
let ty = substs.type_at(0);
if ty.needs_drop(tcx, ty::ParamEnv::empty(traits::Reveal::All)) {
if ty.needs_drop(tcx, ty::ParamEnv::reveal_all()) {
debug!(" => nontrivial drop glue");
ty::InstanceDef::DropGlue(def_id, Some(ty))
} else {