]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_codegen_llvm/context.rs
Auto merge of #60252 - davidtwco:issue-57672, r=Mark-Simulacrum
[rust.git] / src / librustc_codegen_llvm / context.rs
index fc79e868fb4bf635f1bec3a11328e2774d1a238b..7bf8f705ea8ad84d2427bb70c3a6b557463ae385 100644 (file)
@@ -8,7 +8,6 @@
 
 use crate::monomorphize::partitioning::CodegenUnit;
 use crate::type_::Type;
-use crate::type_of::PointeeInfo;
 use rustc_codegen_ssa::traits::*;
 
 use rustc_data_structures::base_n;
@@ -16,7 +15,9 @@
 use rustc::mir::mono::Stats;
 use rustc::session::config::{self, DebugInfo};
 use rustc::session::Session;
-use rustc::ty::layout::{LayoutError, LayoutOf, Size, TyLayout, VariantIdx};
+use rustc::ty::layout::{
+    LayoutError, LayoutOf, PointeeInfo, Size, TyLayout, VariantIdx, HasParamEnv
+};
 use rustc::ty::{self, Ty, TyCtxt};
 use rustc::util::nodemap::FxHashMap;
 use rustc_target::spec::{HasTargetSpec, Target};
@@ -372,7 +373,6 @@ fn eh_personality(&self) -> &'ll Value {
     // Returns a Value of the "eh_unwind_resume" lang item if one is defined,
     // otherwise declares it as an external function.
     fn eh_unwind_resume(&self) -> &'ll Value {
-        use crate::attributes;
         let unwresume = &self.eh_unwind_resume;
         if let Some(llfn) = unwresume.get() {
             return llfn;
@@ -863,3 +863,9 @@ fn layout_of(&self, ty: Ty<'tcx>) -> Self::TyLayout {
             })
     }
 }
+
+impl<'tcx, 'll> HasParamEnv<'tcx> for CodegenCx<'ll, 'tcx> {
+    fn param_env(&self) -> ty::ParamEnv<'tcx> {
+        ty::ParamEnv::reveal_all()
+    }
+}