Fix warnings
This commit is contained in:
parent
648f491977
commit
b73bda1c3f
@ -13,7 +13,7 @@ use crate::prelude::*;
|
||||
use rustc::middle::allocator::AllocatorKind;
|
||||
use rustc_allocator::{ALLOCATOR_METHODS, AllocatorTy};
|
||||
|
||||
pub fn codegen(tcx: TyCtxt, module: &mut Module<impl Backend + 'static>, kind: AllocatorKind) {
|
||||
pub fn codegen(module: &mut Module<impl Backend + 'static>, kind: AllocatorKind) {
|
||||
let usize_ty = module.target_config().pointer_type();
|
||||
|
||||
for method in ALLOCATOR_METHODS {
|
||||
|
@ -205,17 +205,6 @@ impl<'tcx> CValue<'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn expect_byref(self) -> (Value, TyLayout<'tcx>) {
|
||||
match self {
|
||||
CValue::ByRef(value, layout) => (value, layout),
|
||||
CValue::ByVal(_, _) => bug!("Expected CValue::ByRef, found CValue::ByVal: {:?}", self),
|
||||
CValue::ByValPair(_, _, _) => bug!(
|
||||
"Expected CValue::ByRef, found CValue::ByValPair: {:?}",
|
||||
self
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn value_field<'a>(
|
||||
self,
|
||||
fx: &mut FunctionCx<'a, 'tcx, impl Backend>,
|
||||
|
@ -363,7 +363,7 @@ fn codegen_mono_items<'a, 'tcx: 'a>(
|
||||
match err.downcast::<NonFatal>() {
|
||||
Ok(non_fatal) => {
|
||||
if cfg!(debug_assertions) {
|
||||
writeln!(log.as_mut().unwrap(), "{}", &non_fatal.0);
|
||||
writeln!(log.as_mut().unwrap(), "{}", &non_fatal.0).unwrap();
|
||||
}
|
||||
tcx.sess.err(&non_fatal.0)
|
||||
}
|
||||
@ -382,7 +382,7 @@ fn codegen_mono_items<'a, 'tcx: 'a>(
|
||||
});
|
||||
if any_dynamic_crate {
|
||||
} else if let Some(kind) = *tcx.sess.allocator_kind.get() {
|
||||
allocator::codegen(tcx, module, kind);
|
||||
allocator::codegen(module, kind);
|
||||
}
|
||||
|
||||
ccx.finalize(tcx, module);
|
||||
|
Loading…
x
Reference in New Issue
Block a user