Skip to content

Commit 681f143

Browse files
author
Ellen Arteca
committed
clippy
1 parent 576a492 commit 681f143

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

src/c_ffi_support.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -102,27 +102,27 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
102102
match prim_type {
103103
// ints
104104
hir::PrimTy::Int(IntTy::I8) => {
105-
let x = call::<i8>(ptr, &libffi_args.as_slice());
105+
let x = call::<i8>(ptr, libffi_args.as_slice());
106106
this.write_int(x, dest)?;
107107
return Ok(());
108108
}
109109
hir::PrimTy::Int(IntTy::I16) => {
110-
let x = call::<i16>(ptr, &libffi_args.as_slice());
110+
let x = call::<i16>(ptr, libffi_args.as_slice());
111111
this.write_int(x, dest)?;
112112
return Ok(());
113113
}
114114
hir::PrimTy::Int(IntTy::I32) => {
115-
let x = call::<i32>(ptr, &libffi_args.as_slice());
115+
let x = call::<i32>(ptr, libffi_args.as_slice());
116116
this.write_int(x, dest)?;
117117
return Ok(());
118118
}
119119
hir::PrimTy::Int(IntTy::I64) => {
120-
let x = call::<i64>(ptr, &libffi_args.as_slice());
120+
let x = call::<i64>(ptr, libffi_args.as_slice());
121121
this.write_int(x, dest)?;
122122
return Ok(());
123123
}
124124
hir::PrimTy::Int(IntTy::Isize) => {
125-
let x = call::<isize>(ptr, &libffi_args.as_slice());
125+
let x = call::<isize>(ptr, libffi_args.as_slice());
126126
if isize::BITS == 64 {
127127
this.write_int(x as i64, dest)?;
128128
} else if usize::BITS == 32 {
@@ -134,27 +134,27 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
134134
}
135135
// uints
136136
hir::PrimTy::Uint(UintTy::U8) => {
137-
let x = call::<u8>(ptr, &libffi_args.as_slice());
137+
let x = call::<u8>(ptr, libffi_args.as_slice());
138138
this.write_int(x, dest)?;
139139
return Ok(());
140140
}
141141
hir::PrimTy::Uint(UintTy::U16) => {
142-
let x = call::<u16>(ptr, &libffi_args.as_slice());
142+
let x = call::<u16>(ptr, libffi_args.as_slice());
143143
this.write_int(x, dest)?;
144144
return Ok(());
145145
}
146146
hir::PrimTy::Uint(UintTy::U32) => {
147-
let x = call::<u32>(ptr, &libffi_args.as_slice());
147+
let x = call::<u32>(ptr, libffi_args.as_slice());
148148
this.write_int(x, dest)?;
149149
return Ok(());
150150
}
151151
hir::PrimTy::Uint(UintTy::U64) => {
152-
let x = call::<u64>(ptr, &libffi_args.as_slice());
152+
let x = call::<u64>(ptr, libffi_args.as_slice());
153153
this.write_int(x, dest)?;
154154
return Ok(());
155155
}
156156
hir::PrimTy::Uint(UintTy::Usize) => {
157-
let x = call::<usize>(ptr, &libffi_args.as_slice());
157+
let x = call::<usize>(ptr, libffi_args.as_slice());
158158
if usize::BITS == 64 {
159159
this.write_int(x as u64, dest)?;
160160
} else if usize::BITS == 32 {
@@ -168,7 +168,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
168168
}
169169
}
170170
if matches!(external_fct_defn.output_type, hir::FnRetTy::DefaultReturn(_)) {
171-
call::<()>(ptr, &libffi_args.as_slice());
171+
call::<()>(ptr, libffi_args.as_slice());
172172
return Ok(());
173173
}
174174
// TODO ellen! deal with all the other return types
@@ -242,7 +242,7 @@ pub struct ExternalCFuncDeclRep<'hir> {
242242
/// Enum of supported arguments to external C functions.
243243
pub enum CArg {
244244
/// Invalid argument (unsupported type).
245-
INVALID,
245+
Invalid,
246246
/// 8-bit signed integer.
247247
Int8(i8),
248248
/// 16-bit signed integer.

src/shims/foreign_items.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
369369

370370
// First deal with any external C functions in linked .so file
371371
// (if any SO file is specified).
372-
if let Some(_) = this.machine.external_c_so_lib.as_ref() {
372+
if this.machine.external_c_so_lib.as_ref().is_some() {
373373
if let Some(local_id) = def_id.as_local() {
374374
if let Some(extern_c_fct_rep) = ExternalCFuncDeclRep::from_hir_node(
375375
&tcx.hir().get(tcx.hir().local_def_id_to_hir_id(local_id)),

0 commit comments

Comments
 (0)