Skip to content

Commit 80d5478

Browse files
committed
removing param_env from pointee_info_at
1 parent 94a4892 commit 80d5478

File tree

5 files changed

+11
-17
lines changed

5 files changed

+11
-17
lines changed

src/librustc/ty/layout.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -1677,8 +1677,6 @@ impl<'a, 'tcx, C> TyLayoutMethods<'tcx, C> for Ty<'tcx>
16771677
C::TyLayout: MaybeResult<TyLayout<'tcx>>,
16781678
C: HasParamEnv<'tcx>
16791679
{
1680-
type ParamEnv = ty::ParamEnv<'tcx>;
1681-
16821680
fn for_variant(this: TyLayout<'tcx>, cx: &C, variant_index: VariantIdx) -> TyLayout<'tcx> {
16831681
let details = match this.variants {
16841682
Variants::Single { index } if index == variant_index => this.details,
@@ -1850,7 +1848,6 @@ impl<'a, 'tcx, C> TyLayoutMethods<'tcx, C> for Ty<'tcx>
18501848
this: TyLayout<'tcx>,
18511849
cx: &C,
18521850
offset: Size,
1853-
param_env: Self::ParamEnv,
18541851
) -> Option<PointeeInfo> {
18551852
match this.ty.sty {
18561853
ty::RawPtr(mt) if offset.bytes() == 0 => {
@@ -1864,7 +1861,7 @@ impl<'a, 'tcx, C> TyLayoutMethods<'tcx, C> for Ty<'tcx>
18641861

18651862
ty::Ref(_, ty, mt) if offset.bytes() == 0 => {
18661863
let tcx = cx.tcx();
1867-
let is_freeze = ty.is_freeze(tcx, param_env, DUMMY_SP);
1864+
let is_freeze = ty.is_freeze(tcx, cx.param_env(), DUMMY_SP);
18681865
let kind = match mt {
18691866
hir::MutImmutable => if is_freeze {
18701867
PointerKind::Frozen
@@ -1945,7 +1942,7 @@ impl<'a, 'tcx, C> TyLayoutMethods<'tcx, C> for Ty<'tcx>
19451942
.and_then(|field| {
19461943
if ptr_end <= field_start + field.size {
19471944
// We found the right field, look inside it.
1948-
field.pointee_info_at(cx, offset - field_start, param_env)
1945+
field.pointee_info_at(cx, offset - field_start)
19491946
} else {
19501947
None
19511948
}

src/librustc_codegen_llvm/abi.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use rustc_target::abi::call::ArgType;
1212
use rustc_codegen_ssa::traits::*;
1313

1414
use rustc_target::abi::{HasDataLayout, LayoutOf, Size, TyLayout, Abi as LayoutAbi};
15-
use rustc::ty::{self, Ty, Instance, ParamEnv};
15+
use rustc::ty::{self, Ty, Instance};
1616
use rustc::ty::layout::{self, PointerKind};
1717

1818
use libc::c_uint;
@@ -478,7 +478,7 @@ impl<'tcx> FnTypeExt<'tcx> for FnType<'tcx, Ty<'tcx>> {
478478
}
479479
}
480480

481-
if let Some(pointee) = layout.pointee_info_at(cx, offset, ParamEnv::reveal_all()) {
481+
if let Some(pointee) = layout.pointee_info_at(cx, offset) {
482482
if let Some(kind) = pointee.safe {
483483
attrs.pointee_size = pointee.size;
484484
attrs.pointee_align = Some(pointee.align);

src/librustc_codegen_llvm/context.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ use rustc_data_structures::small_c_str::SmallCStr;
1515
use rustc::mir::mono::Stats;
1616
use rustc::session::config::{self, DebugInfo};
1717
use rustc::session::Session;
18-
use rustc::ty::layout::{LayoutError, LayoutOf, PointeeInfo, Size, TyLayout, VariantIdx, HasParamEnv};
18+
use rustc::ty::layout::{
19+
LayoutError, LayoutOf, PointeeInfo, Size, TyLayout, VariantIdx, HasParamEnv
20+
};
1921
use rustc::ty::{self, Ty, TyCtxt};
2022
use rustc::util::nodemap::FxHashMap;
2123
use rustc_target::spec::{HasTargetSpec, Target};
@@ -864,6 +866,6 @@ impl LayoutOf for CodegenCx<'ll, 'tcx> {
864866

865867
impl<'tcx, 'll> HasParamEnv<'tcx> for CodegenCx<'ll, 'tcx> {
866868
fn param_env(&self) -> ty::ParamEnv<'tcx> {
867-
panic!("asd")
869+
ty::ParamEnv::reveal_all()
868870
}
869871
}

src/librustc_codegen_llvm/type_of.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ impl<'tcx> LayoutLlvmExt<'tcx> for TyLayout<'tcx> {
383383
return pointee;
384384
}
385385

386-
let result = Ty::pointee_info_at(*self, cx, offset, ty::ParamEnv::reveal_all());
386+
let result = Ty::pointee_info_at(*self, cx, offset);
387387

388388
cx.pointee_infos.borrow_mut().insert((self.ty, offset), result);
389389
result

src/librustc_target/abi/mod.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -933,8 +933,6 @@ pub struct PointeeInfo {
933933
}
934934

935935
pub trait TyLayoutMethods<'a, C: LayoutOf<Ty = Self>>: Sized {
936-
type ParamEnv;
937-
938936
fn for_variant(
939937
this: TyLayout<'a, Self>,
940938
cx: &C,
@@ -945,7 +943,6 @@ pub trait TyLayoutMethods<'a, C: LayoutOf<Ty = Self>>: Sized {
945943
this: TyLayout<'a, Self>,
946944
cx: &C,
947945
offset: Size,
948-
param_env: Self::ParamEnv,
949946
) -> Option<PointeeInfo>;
950947
}
951948

@@ -958,11 +955,9 @@ impl<'a, Ty> TyLayout<'a, Ty> {
958955
where Ty: TyLayoutMethods<'a, C>, C: LayoutOf<Ty = Ty> {
959956
Ty::field(self, cx, i)
960957
}
961-
pub fn pointee_info_at<C>(
962-
self, cx: &C, offset: Size, param_env: Ty::ParamEnv
963-
) -> Option<PointeeInfo>
958+
pub fn pointee_info_at<C>(self, cx: &C, offset: Size) -> Option<PointeeInfo>
964959
where Ty: TyLayoutMethods<'a, C>, C: LayoutOf<Ty = Ty> {
965-
Ty::pointee_info_at(self, cx, offset, param_env)
960+
Ty::pointee_info_at(self, cx, offset)
966961
}
967962
}
968963

0 commit comments

Comments
 (0)