Fix even more clippy warnings
This commit is contained in:
parent
bfecb18771
commit
57c6ed0c07
53 changed files with 276 additions and 520 deletions
|
@ -93,7 +93,7 @@ pub(crate) unsafe fn codegen(
|
|||
let args = [usize, usize]; // size, align
|
||||
|
||||
let ty = llvm::LLVMFunctionType(void, args.as_ptr(), args.len() as c_uint, False);
|
||||
let name = format!("__rust_alloc_error_handler");
|
||||
let name = "__rust_alloc_error_handler".to_string();
|
||||
let llfn = llvm::LLVMRustGetOrInsertFunction(llmod, name.as_ptr().cast(), name.len(), ty);
|
||||
// -> ! DIFlagNoReturn
|
||||
llvm::Attribute::NoReturn.apply_llfn(llvm::AttributePlace::Function, llfn);
|
||||
|
|
|
@ -302,13 +302,11 @@ impl AsmBuilderMethods<'tcx> for Builder<'a, 'll, 'tcx> {
|
|||
} else if options.contains(InlineAsmOptions::READONLY) {
|
||||
llvm::Attribute::ReadOnly.apply_callsite(llvm::AttributePlace::Function, result);
|
||||
}
|
||||
} else if options.contains(InlineAsmOptions::NOMEM) {
|
||||
llvm::Attribute::InaccessibleMemOnly
|
||||
.apply_callsite(llvm::AttributePlace::Function, result);
|
||||
} else {
|
||||
if options.contains(InlineAsmOptions::NOMEM) {
|
||||
llvm::Attribute::InaccessibleMemOnly
|
||||
.apply_callsite(llvm::AttributePlace::Function, result);
|
||||
} else {
|
||||
// LLVM doesn't have an attribute to represent ReadOnly + SideEffect
|
||||
}
|
||||
// LLVM doesn't have an attribute to represent ReadOnly + SideEffect
|
||||
}
|
||||
|
||||
// Write results to outputs
|
||||
|
|
|
@ -900,7 +900,7 @@ impl ThinLTOKeysMap {
|
|||
let file = File::open(path)?;
|
||||
for line in io::BufReader::new(file).lines() {
|
||||
let line = line?;
|
||||
let mut split = line.split(" ");
|
||||
let mut split = line.split(' ');
|
||||
let module = split.next().unwrap();
|
||||
let key = split.next().unwrap();
|
||||
assert_eq!(split.next(), None, "Expected two space-separated values, found {:?}", line);
|
||||
|
|
|
@ -732,10 +732,7 @@ impl BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
|
|||
let src_ty = self.cx.val_ty(val);
|
||||
let float_width = self.cx.float_width(src_ty);
|
||||
let int_width = self.cx.int_width(dest_ty);
|
||||
match (int_width, float_width) {
|
||||
(32, 32) | (32, 64) | (64, 32) | (64, 64) => true,
|
||||
_ => false,
|
||||
}
|
||||
matches!((int_width, float_width), (32, 32) | (32, 64) | (64, 32) | (64, 64))
|
||||
}
|
||||
|
||||
fn fptoui(&mut self, val: &'ll Value, dest_ty: &'ll Type) -> &'ll Value {
|
||||
|
|
|
@ -397,10 +397,8 @@ impl StaticMethods for CodegenCx<'ll, 'tcx> {
|
|||
|
||||
// As an optimization, all shared statics which do not have interior
|
||||
// mutability are placed into read-only memory.
|
||||
if !is_mutable {
|
||||
if self.type_is_freeze(ty) {
|
||||
llvm::LLVMSetGlobalConstant(g, llvm::True);
|
||||
}
|
||||
if !is_mutable && self.type_is_freeze(ty) {
|
||||
llvm::LLVMSetGlobalConstant(g, llvm::True);
|
||||
}
|
||||
|
||||
debuginfo::create_global_var_metadata(&self, def_id, g);
|
||||
|
|
|
@ -122,10 +122,10 @@ pub unsafe fn create_module(
|
|||
if llvm_util::get_major_version() < 9 {
|
||||
target_data_layout = strip_function_ptr_alignment(target_data_layout);
|
||||
}
|
||||
if llvm_util::get_major_version() < 10 {
|
||||
if sess.target.arch == "x86" || sess.target.arch == "x86_64" {
|
||||
target_data_layout = strip_x86_address_spaces(target_data_layout);
|
||||
}
|
||||
if llvm_util::get_major_version() < 10
|
||||
&& (sess.target.arch == "x86" || sess.target.arch == "x86_64")
|
||||
{
|
||||
target_data_layout = strip_x86_address_spaces(target_data_layout);
|
||||
}
|
||||
|
||||
// Ensure the data-layout values hardcoded remain the defaults.
|
||||
|
@ -864,7 +864,7 @@ impl<'b, 'tcx> CodegenCx<'b, 'tcx> {
|
|||
// user defined names
|
||||
let mut name = String::with_capacity(prefix.len() + 6);
|
||||
name.push_str(prefix);
|
||||
name.push_str(".");
|
||||
name.push('.');
|
||||
base_n::push_str(idx as u128, base_n::ALPHANUMERIC_ONLY, &mut name);
|
||||
name
|
||||
}
|
||||
|
|
|
@ -435,7 +435,7 @@ impl DebugInfoMethods<'tcx> for CodegenCx<'ll, 'tcx> {
|
|||
name_to_append_suffix_to.push('<');
|
||||
for (i, actual_type) in substs.types().enumerate() {
|
||||
if i != 0 {
|
||||
name_to_append_suffix_to.push_str(",");
|
||||
name_to_append_suffix_to.push(',');
|
||||
}
|
||||
|
||||
let actual_type =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue