diff --git a/src/constant.rs b/src/constant.rs index 4dcbf1da82c..0fc1b52b2f2 100644 --- a/src/constant.rs +++ b/src/constant.rs @@ -5,7 +5,7 @@ use rustc::mir::interpret::{ }; use rustc::ty::Const; use rustc_mir::interpret::{ - EvalContext, Machine, MemPlace, Memory, MemoryKind, OpTy, PlaceTy, Pointer, + EvalContext, MPlaceTy, Machine, Memory, MemoryKind, OpTy, PlaceTy, Pointer, }; use cranelift_module::*; @@ -160,13 +160,12 @@ fn data_id_for_static<'a, 'tcx: 'a, B: Backend>( def_id: DefId, ) -> DataId { let symbol_name = tcx.symbol_name(Instance::mono(tcx, def_id)).as_str(); - let is_mutable = - if let crate::rustc::hir::Mutability::MutMutable = tcx.is_static(def_id).unwrap() { - true - } else { - !tcx.type_of(def_id) - .is_freeze(tcx, ParamEnv::reveal_all(), DUMMY_SP) - }; + let is_mutable = if let ::rustc::hir::Mutability::MutMutable = tcx.is_static(def_id).unwrap() { + true + } else { + !tcx.type_of(def_id) + .is_freeze(tcx, ParamEnv::reveal_all(), DUMMY_SP) + }; module .declare_data(&*symbol_name, Linkage::Export, is_mutable) .unwrap() @@ -314,7 +313,7 @@ impl<'a, 'mir, 'tcx> Machine<'a, 'mir, 'tcx> for TransPlaceInterpreter { } fn find_foreign_static( - _: crate::rustc::ty::query::TyCtxtAt<'a, 'tcx, 'tcx>, + _: ::rustc::ty::query::TyCtxtAt<'a, 'tcx, 'tcx>, _: DefId, ) -> EvalResult<'tcx, Cow<'tcx, Allocation>> { panic!(); @@ -337,21 +336,17 @@ impl<'a, 'mir, 'tcx> Machine<'a, 'mir, 'tcx> for TransPlaceInterpreter { fn tag_reference( _: &mut EvalContext<'a, 'mir, 'tcx, Self>, - _: MemPlace, - _: Ty<'tcx>, - _: Size, - _: Option, - ) -> EvalResult<'tcx, MemPlace> { + _: MPlaceTy<'tcx>, + _: Option<::rustc::hir::Mutability>, + ) -> EvalResult<'tcx, Scalar> { panic!() } fn tag_dereference( _: &EvalContext<'a, 'mir, 'tcx, Self>, - _: MemPlace, - _: Ty<'tcx>, - _: Size, - _: Option, - ) -> EvalResult<'tcx, MemPlace> { + _: MPlaceTy<'tcx>, + _: Option<::rustc::hir::Mutability>, + ) -> EvalResult<'tcx, Scalar> { panic!(); } diff --git a/src/lib.rs b/src/lib.rs index 912184dd8f3..f7af549c8a4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -258,8 +258,7 @@ impl CodegenBackend for CraneliftCodegenBackend { .expect("Expected CraneliftCodegenBackend's CodegenResult, found Box"); for &crate_type in sess.opts.crate_types.iter() { - let output_name = - out_filename(sess, crate_type, &outputs, &res.crate_name.as_str()); + let output_name = out_filename(sess, crate_type, &outputs, &res.crate_name.as_str()); match crate_type { CrateType::Rlib => link::link_rlib(sess, &res, output_name), CrateType::Executable => link::link_bin(sess, &res, output_name), diff --git a/src/link.rs b/src/link.rs index 822c908da42..82afe6fd677 100644 --- a/src/link.rs +++ b/src/link.rs @@ -3,11 +3,7 @@ use std::path::PathBuf; use rustc::session::Session; -pub(crate) fn link_rlib( - sess: &Session, - res: &crate::CodegenResult, - output_name: PathBuf, -) { +pub(crate) fn link_rlib(sess: &Session, res: &crate::CodegenResult, output_name: PathBuf) { let file = File::create(&output_name).unwrap(); let mut builder = ar::Builder::new(file); @@ -52,7 +48,6 @@ pub(crate) fn link_bin(sess: &Session, res: &crate::CodegenResult, output_name: std::fs::write(output_name, obj).unwrap(); } - /* res.artifact .declare_with(