use rustc::ty::subst::Substs;
use rustc::ty::{self, Ty, TyCtxt};
use rustc::ty::layout::{LayoutTyper, TyLayout};
-use session::config::NoDebugInfo;
-use session::Session;
-use session::config;
-use util::nodemap::{NodeSet, DefIdMap, FxHashMap};
+use rustc::session::config::{self, NoDebugInfo};
+use rustc::session::Session;
+use rustc::util::nodemap::{NodeSet, DefIdMap, FxHashMap};
use std::ffi::{CStr, CString};
use std::cell::{Cell, RefCell};
pub struct SharedCrateContext<'a, 'tcx: 'a> {
exported_symbols: NodeSet,
tcx: TyCtxt<'a, 'tcx, 'tcx>,
- empty_param_env: ty::ParameterEnvironment<'tcx>,
check_overflow: bool,
use_dll_storage_attrs: bool,
SharedCrateContext {
exported_symbols: exported_symbols,
- empty_param_env: tcx.empty_parameter_environment(),
tcx: tcx,
check_overflow: check_overflow,
use_dll_storage_attrs: use_dll_storage_attrs,
}
pub fn type_needs_drop(&self, ty: Ty<'tcx>) -> bool {
- ty.needs_drop(self.tcx, &self.empty_param_env)
+ ty.needs_drop(self.tcx, ty::ParamEnv::empty(traits::Reveal::All))
}
pub fn type_is_sized(&self, ty: Ty<'tcx>) -> bool {
- ty.is_sized(self.tcx, &self.empty_param_env, DUMMY_SP)
+ ty.is_sized(self.tcx, ty::ParamEnv::empty(traits::Reveal::All), DUMMY_SP)
}
pub fn type_is_freeze(&self, ty: Ty<'tcx>) -> bool {
- ty.is_freeze(self.tcx, &self.empty_param_env, DUMMY_SP)
+ ty.is_freeze(self.tcx, ty::ParamEnv::empty(traits::Reveal::All), DUMMY_SP)
}
pub fn exported_symbols<'a>(&'a self) -> &'a NodeSet {
let dbg_cx = if shared.tcx.sess.opts.debuginfo != NoDebugInfo {
let dctx = debuginfo::CrateDebugContext::new(llmod);
- debuginfo::metadata::compile_unit_metadata(shared, &dctx, shared.tcx.sess);
+ debuginfo::metadata::compile_unit_metadata(shared,
+ codegen_unit.name(),
+ &dctx,
+ shared.tcx.sess);
Some(dctx)
} else {
None
return TyLayout { ty: ty, layout: layout, variant_index: None };
}
- self.tcx().infer_ctxt((), traits::Reveal::All).enter(|infcx| {
+ self.tcx().infer_ctxt(traits::Reveal::All).enter(|infcx| {
infcx.layout_of(ty).unwrap_or_else(|e| {
match e {
ty::layout::LayoutError::SizeOverflow(_) =>