Skip to content

Commit 87dc07c

Browse files
oisyneddyb
authored andcommitted
More clippy fixes
1 parent fbbe2f7 commit 87dc07c

File tree

7 files changed

+15
-23
lines changed

7 files changed

+15
-23
lines changed

crates/rustc_codegen_spirv/src/abi.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -662,8 +662,8 @@ fn trans_aggregate<'tcx>(cx: &CodegenCx<'tcx>, span: Span, ty: TyAndLayout<'tcx>
662662
}
663663

664664
// returns (field_offsets, size, align)
665-
pub fn auto_struct_layout<'tcx>(
666-
cx: &CodegenCx<'tcx>,
665+
pub fn auto_struct_layout(
666+
cx: &CodegenCx<'_>,
667667
field_types: &[Word],
668668
) -> (Vec<Size>, Option<Size>, Align) {
669669
// FIXME(eddyb) use `AccumulateVec`s just like `rustc` itself does.

crates/rustc_codegen_spirv/src/attr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ impl AggregatedSpirvAttributes {
228228
}
229229

230230
// FIXME(eddyb) make this reusable from somewhere in `rustc`.
231-
fn target_from_impl_item<'tcx>(tcx: TyCtxt<'tcx>, impl_item: &hir::ImplItem<'_>) -> Target {
231+
fn target_from_impl_item(tcx: TyCtxt<'_>, impl_item: &hir::ImplItem<'_>) -> Target {
232232
match impl_item.kind {
233233
hir::ImplItemKind::Const(..) => Target::AssocConst,
234234
hir::ImplItemKind::Fn(..) => {

crates/rustc_codegen_spirv/src/builder/ext_inst.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub struct ExtInst {
1313
}
1414

1515
impl ExtInst {
16-
pub fn import_glsl<'a, 'tcx>(&mut self, bx: &Builder<'a, 'tcx>) -> Word {
16+
pub fn import_glsl(&mut self, bx: &Builder<'_, '_>) -> Word {
1717
if let Some(id) = self.glsl {
1818
id
1919
} else {
@@ -23,11 +23,7 @@ impl ExtInst {
2323
}
2424
}
2525

26-
pub fn require_integer_functions_2_intel<'a, 'tcx>(
27-
&mut self,
28-
bx: &Builder<'a, 'tcx>,
29-
to_zombie: Word,
30-
) {
26+
pub fn require_integer_functions_2_intel(&mut self, bx: &Builder<'_, '_>, to_zombie: Word) {
3127
if !self.integer_functions_2_intel {
3228
self.integer_functions_2_intel = true;
3329
if !bx

crates/rustc_codegen_spirv/src/builder/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ impl<'a, 'tcx> ArgAbiMethods<'tcx> for Builder<'a, 'tcx> {
319319
idx: &mut usize,
320320
dst: PlaceRef<'tcx, Self::Value>,
321321
) {
322-
fn next<'a, 'tcx>(bx: &mut Builder<'a, 'tcx>, idx: &mut usize) -> SpirvValue {
322+
fn next(bx: &mut Builder<'_, '_>, idx: &mut usize) -> SpirvValue {
323323
let val = bx.function_parameter_values.borrow()[&bx.current_fn.def(bx)][*idx];
324324
*idx += 1;
325325
val

crates/rustc_codegen_spirv/src/lib.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,7 @@ use std::io::Write;
114114
use std::path::Path;
115115
use std::sync::Arc;
116116

117-
fn dump_mir<'tcx>(
118-
tcx: TyCtxt<'tcx>,
119-
mono_items: &[(MonoItem<'_>, (Linkage, Visibility))],
120-
path: &Path,
121-
) {
117+
fn dump_mir(tcx: TyCtxt<'_>, mono_items: &[(MonoItem<'_>, (Linkage, Visibility))], path: &Path) {
122118
create_dir_all(path.parent().unwrap()).unwrap();
123119
let mut file = File::create(path).unwrap();
124120
for &(mono_item, (_, _)) in mono_items {
@@ -384,9 +380,9 @@ impl WriteBackendMethods for SpirvCodegenBackend {
384380
}
385381

386382
impl ExtraBackendMethods for SpirvCodegenBackend {
387-
fn codegen_allocator<'tcx>(
383+
fn codegen_allocator(
388384
&self,
389-
_: TyCtxt<'tcx>,
385+
_: TyCtxt<'_>,
390386
_: &str,
391387
_: AllocatorKind,
392388
_: AllocatorKind,

crates/rustc_codegen_spirv/src/link.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ use std::iter;
2727
use std::path::{Path, PathBuf};
2828
use std::sync::Arc;
2929

30-
pub fn link<'a>(
31-
sess: &'a Session,
30+
pub fn link(
31+
sess: &Session,
3232
codegen_results: &CodegenResults,
3333
outputs: &OutputFilenames,
3434
crate_name: &str,
@@ -380,9 +380,9 @@ fn do_spirv_val(
380380
}
381381
}
382382

383-
fn link_local_crate_native_libs_and_dependent_crate_libs<'a>(
383+
fn link_local_crate_native_libs_and_dependent_crate_libs(
384384
rlibs: &mut Vec<PathBuf>,
385-
sess: &'a Session,
385+
sess: &Session,
386386
crate_type: CrateType,
387387
codegen_results: &CodegenResults,
388388
) {

crates/rustc_codegen_spirv/src/spirv_type.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -628,8 +628,8 @@ impl fmt::Display for SpirvTypePrinter<'_, '_> {
628628

629629
impl SpirvTypePrinter<'_, '_> {
630630
fn display(&self, stack: &mut Vec<Word>, f: &mut fmt::Formatter<'_>) -> fmt::Result {
631-
fn ty<'tcx>(
632-
cx: &CodegenCx<'tcx>,
631+
fn ty(
632+
cx: &CodegenCx<'_>,
633633
stack: &mut Vec<Word>,
634634
f: &mut fmt::Formatter<'_>,
635635
ty: Word,

0 commit comments

Comments
 (0)