diff --git a/src/builder.rs b/src/builder.rs index c5d3ed8c8a1..663e42aaf85 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -26,7 +26,6 @@ use rustc_codegen_ssa::traits::{ use rustc_data_structures::fx::FxHashSet; use rustc_middle::bug; use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrs; -use rustc_middle::mir::Rvalue; use rustc_middle::ty::{ParamEnv, Ty, TyCtxt}; use rustc_middle::ty::layout::{FnAbiError, FnAbiOfHelpers, FnAbiRequest, HasParamEnv, HasTyCtxt, LayoutError, LayoutOfHelpers, TyAndLayout}; use rustc_span::Span; @@ -401,9 +400,8 @@ impl<'gcc, 'tcx> BackendTypes for Builder<'_, 'gcc, 'tcx> { pub fn set_rval_location<'a, 'gcc, 'tcx>(bx: &mut Builder<'a,'gcc,'tcx>, r:RValue<'gcc>) -> RValue<'gcc> { if bx.loc.is_some(){ - unsafe { - r.set_location(bx.loc.unwrap()); - } + #[cfg(feature = "master")] + r.set_location(bx.loc.unwrap()); } r @@ -545,9 +543,8 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> { fn fmul(&mut self, a: RValue<'gcc>, b: RValue<'gcc>) -> RValue<'gcc> { let i=a * b; if self.loc.is_some() { - unsafe{ - i.set_location(self.loc.clone().unwrap()); - } + #[cfg(feature = "master")] + i.set_location(self.loc.clone().unwrap()); } i } @@ -666,7 +663,8 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> { let ret = self.cx.gcc_or(a, b, self.loc); if self.loc.is_some() { - unsafe { ret.set_location(self.loc.unwrap()); } + #[cfg(feature = "master")] + ret.set_location(self.loc.unwrap()); } ret } diff --git a/src/debuginfo.rs b/src/debuginfo.rs index e01624ce15e..0ac5841df63 100644 --- a/src/debuginfo.rs +++ b/src/debuginfo.rs @@ -32,10 +32,8 @@ impl<'a, 'gcc, 'tcx> DebugInfoBuilderMethods for Builder<'a, 'gcc, 'tcx> { _fragment: Option>, ) { // Not sure if this is correct, probably wrong but still keep it here. - unsafe { - #[cfg(feature = "master")] - variable_alloca.set_location(dbg_loc); - } + #[cfg(feature = "master")] + variable_alloca.set_location(dbg_loc); } fn insert_reference_to_gdb_debug_scripts_section_global(&mut self) { @@ -45,7 +43,7 @@ impl<'a, 'gcc, 'tcx> DebugInfoBuilderMethods for Builder<'a, 'gcc, 'tcx> { /// Currently, this function is not yet implemented. It seems that the /// debug name and the mangled name should both be included in the LValues. /// Besides, a function to get the rvalue type(m_is_lvalue) should also be included. - fn set_var_name(&mut self, value: RValue<'gcc>, name: &str) { + fn set_var_name(&mut self, _value: RValue<'gcc>, _name: &str) { //unimplemented!(); } @@ -264,7 +262,7 @@ impl<'gcc, 'tcx> DebugInfoMethods<'tcx> for CodegenCx<'gcc, 'tcx> { } rustc_span::RealFileName::Remapped { local_path, - virtual_name, + virtual_name:_, } => if let Some(name) = local_path.as_ref() { if let Some(name) = name.to_str(){ self.context.new_location(