Skip to content

Commit e2a0998

Browse files
authored
Merge pull request rust-lang#170 from dwrensha/rustup
update for upstream changes with ty::ParamEnv
2 parents 5483806 + 48662d5 commit e2a0998

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/eval_context.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
377377
pub(super) fn type_is_sized(&self, ty: Ty<'tcx>) -> bool {
378378
// generics are weird, don't run this function on a generic
379379
assert!(!ty.needs_subst());
380-
ty.is_sized(self.tcx, &self.tcx.empty_parameter_environment(), DUMMY_SP)
380+
ty.is_sized(self.tcx, ty::ParamEnv::empty(), DUMMY_SP)
381381
}
382382

383383
pub fn load_mir(&self, instance: ty::InstanceDef<'tcx>) -> EvalResult<'tcx, &'tcx mir::Mir<'tcx>> {
@@ -1914,14 +1914,14 @@ pub fn needs_drop_glue<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, t: Ty<'tcx>) -> bo
19141914
// returned `false` does not appear unsound. The impact on
19151915
// code quality is unknown at this time.)
19161916

1917-
let env = tcx.empty_parameter_environment();
1918-
if !t.needs_drop(tcx, &env) {
1917+
let env = ty::ParamEnv::empty();
1918+
if !t.needs_drop(tcx, env) {
19191919
return false;
19201920
}
19211921
match t.sty {
19221922
ty::TyAdt(def, _) if def.is_box() => {
19231923
let typ = t.boxed_ty();
1924-
if !typ.needs_drop(tcx, &env) && type_is_sized(tcx, typ) {
1924+
if !typ.needs_drop(tcx, env) && type_is_sized(tcx, typ) {
19251925
tcx.infer_ctxt((), traits::Reveal::All).enter(|infcx| {
19261926
let layout = t.layout(&infcx).unwrap();
19271927
// `Box<ZeroSizeType>` does not allocate.
@@ -2038,7 +2038,7 @@ impl<'a, 'tcx> ::rustc::ty::fold::TypeFolder<'tcx, 'tcx> for AssociatedTypeNorma
20382038
fn type_is_sized<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, ty: Ty<'tcx>) -> bool {
20392039
// generics are weird, don't run this function on a generic
20402040
assert!(!ty.needs_subst());
2041-
ty.is_sized(tcx, &tcx.empty_parameter_environment(), DUMMY_SP)
2041+
ty.is_sized(tcx, ty::ParamEnv::empty(), DUMMY_SP)
20422042
}
20432043

20442044
/// Attempts to resolve an obligation. The result is a shallow vtable resolution -- meaning that we

src/step.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ impl<'a, 'b, 'tcx> ConstantExtractor<'a, 'b, 'tcx> {
164164
let mutable = !shared ||
165165
!mir.return_ty.is_freeze(
166166
this.ecx.tcx,
167-
&this.ecx.tcx.empty_parameter_environment(),
167+
ty::ParamEnv::empty(),
168168
span);
169169
let cleanup = StackPopCleanup::MarkStatic(mutable);
170170
let name = ty::tls::with(|tcx| tcx.item_path_str(def_id));

src/terminator/intrinsic.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,8 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
291291

292292
"needs_drop" => {
293293
let ty = substs.type_at(0);
294-
let env = self.tcx.empty_parameter_environment();
295-
let needs_drop = ty.needs_drop(self.tcx, &env);
294+
let env = ty::ParamEnv::empty();
295+
let needs_drop = ty.needs_drop(self.tcx, env);
296296
self.write_primval(dest, PrimVal::from_bool(needs_drop), dest_ty)?;
297297
}
298298

0 commit comments

Comments
 (0)