Skip to content

Commit 390fc73

Browse files
Fix new clippy lints
1 parent 0bdf072 commit 390fc73

File tree

4 files changed

+7
-10
lines changed

4 files changed

+7
-10
lines changed

src/consts.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -191,13 +191,11 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
191191
// TODO(antoyo): check if it's okay that no link_section is set.
192192

193193
let typ = self.val_ty(cv).get_aligned(align.bytes());
194-
let global = self.declare_private_global(&name[..], typ);
195-
global
194+
self.declare_private_global(&name[..], typ)
196195
}
197196
_ => {
198197
let typ = self.val_ty(cv).get_aligned(align.bytes());
199-
let global = self.declare_unnamed_global(typ);
200-
global
198+
self.declare_unnamed_global(typ)
201199
}
202200
};
203201
global.global_set_initializer_rvalue(cv);

src/debuginfo.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ impl<'gcc, 'tcx> DebugInfoCodegenMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
289289
) -> Self::DILocation {
290290
let pos = span.lo();
291291
let DebugLoc { file, line, col } = self.lookup_debug_loc(pos);
292-
let loc = match file.name {
292+
match file.name {
293293
rustc_span::FileName::Real(ref name) => match *name {
294294
rustc_span::RealFileName::LocalPath(ref name) => {
295295
if let Some(name) = name.to_str() {
@@ -314,7 +314,6 @@ impl<'gcc, 'tcx> DebugInfoCodegenMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
314314
}
315315
},
316316
_ => Location::null(),
317-
};
318-
loc
317+
}
319318
}
320319
}

src/declare.rs

+1
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
157157
///
158158
/// If there’s a value with the same name already declared, the function will
159159
/// update the declaration and return existing Value instead.
160+
#[allow(clippy::let_and_return)]
160161
fn declare_raw_fn<'gcc>(
161162
cx: &CodegenCx<'gcc, '_>,
162163
name: &str,

tests/lang_tests_common.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,14 @@ pub fn main_inner(profile: Profile) {
6969
.test_dir("tests/run")
7070
.test_path_filter(filter)
7171
.test_extract(|path| {
72-
let lines = std::fs::read_to_string(path)
72+
std::fs::read_to_string(path)
7373
.expect("read file")
7474
.lines()
7575
.skip_while(|l| !l.starts_with("//"))
7676
.take_while(|l| l.starts_with("//"))
7777
.map(|l| &l[2..])
7878
.collect::<Vec<_>>()
79-
.join("\n");
80-
lines
79+
.join("\n")
8180
})
8281
.test_cmds(move |path| {
8382
// Test command 1: Compile `x.rs` into `tempdir/x`.

0 commit comments

Comments
 (0)