Fix some clippy warnings (#1277)

This commit is contained in:
llogiq
2019-12-07 18:47:43 +01:00
committed by Andrew Brown
parent 2c51341888
commit 0d8f8bc71f
10 changed files with 24 additions and 19 deletions

View File

@@ -46,6 +46,8 @@ pub struct MemoryCodeSink<'a> {
impl<'a> MemoryCodeSink<'a> {
/// Create a new memory code sink that writes a function to the memory pointed to by `data`.
///
/// # Safety
///
/// This function is unsafe since `MemoryCodeSink` does not perform bounds checking on the
/// memory buffer, and it can't guarantee that the `data` pointer is valid.
pub unsafe fn new(

View File

@@ -175,6 +175,8 @@ impl Context {
///
/// The machine code is not relocated. Instead, any relocations are emitted into `relocs`.
///
/// # Safety
///
/// This function is unsafe since it does not perform bounds checking on the memory buffer,
/// and it can't guarantee that the `mem` pointer is valid.
///

View File

@@ -22,7 +22,6 @@
//! ```
//! # extern crate cranelift_codegen;
//! # #[macro_use] extern crate target_lexicon;
//! # fn main() {
//! use cranelift_codegen::isa;
//! use cranelift_codegen::settings::{self, Configurable};
//! use std::str::FromStr;
@@ -40,7 +39,6 @@
//! let isa = isa_builder.finish(shared_flags);
//! }
//! }
//! # }
//! ```
//!
//! The configured target ISA trait object is a `Box<TargetIsa>` which can be used for multiple

View File

@@ -938,7 +938,7 @@ fn insert_common_epilogue(
.entry(fp_pop_inst)
.and_modify(|insts| {
*insts = insts
.into_iter()
.iter()
.cloned()
.chain(std::iter::once(new_cfa))
.collect::<Box<[_]>>();

View File

@@ -73,7 +73,6 @@ fn create_pre_header(
let pool = &mut ListPool::<Value>::new();
let header_args_values = func.dfg.ebb_params(header).to_vec();
let header_args_types: Vec<Type> = header_args_values
.clone()
.into_iter()
.map(|val| func.dfg.value_type(val))
.collect();

View File

@@ -107,7 +107,7 @@ pub struct VerifierError {
fn format_context(context: &Option<String>) -> String {
match context {
None => "".to_string(),
Some(c) => format!(" ({})", c).to_string(),
Some(c) => format!(" ({})", c),
}
}