mirror of
https://github.com/EmbarkStudios/rust-gpu.git
synced 2024-11-21 22:34:34 +00:00
More clippy fixes
This commit is contained in:
parent
fbbe2f7d2d
commit
87dc07c623
@ -662,8 +662,8 @@ fn trans_aggregate<'tcx>(cx: &CodegenCx<'tcx>, span: Span, ty: TyAndLayout<'tcx>
|
||||
}
|
||||
|
||||
// returns (field_offsets, size, align)
|
||||
pub fn auto_struct_layout<'tcx>(
|
||||
cx: &CodegenCx<'tcx>,
|
||||
pub fn auto_struct_layout(
|
||||
cx: &CodegenCx<'_>,
|
||||
field_types: &[Word],
|
||||
) -> (Vec<Size>, Option<Size>, Align) {
|
||||
// FIXME(eddyb) use `AccumulateVec`s just like `rustc` itself does.
|
||||
|
@ -228,7 +228,7 @@ impl AggregatedSpirvAttributes {
|
||||
}
|
||||
|
||||
// FIXME(eddyb) make this reusable from somewhere in `rustc`.
|
||||
fn target_from_impl_item<'tcx>(tcx: TyCtxt<'tcx>, impl_item: &hir::ImplItem<'_>) -> Target {
|
||||
fn target_from_impl_item(tcx: TyCtxt<'_>, impl_item: &hir::ImplItem<'_>) -> Target {
|
||||
match impl_item.kind {
|
||||
hir::ImplItemKind::Const(..) => Target::AssocConst,
|
||||
hir::ImplItemKind::Fn(..) => {
|
||||
|
@ -13,7 +13,7 @@ pub struct ExtInst {
|
||||
}
|
||||
|
||||
impl ExtInst {
|
||||
pub fn import_glsl<'a, 'tcx>(&mut self, bx: &Builder<'a, 'tcx>) -> Word {
|
||||
pub fn import_glsl(&mut self, bx: &Builder<'_, '_>) -> Word {
|
||||
if let Some(id) = self.glsl {
|
||||
id
|
||||
} else {
|
||||
@ -23,11 +23,7 @@ impl ExtInst {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn require_integer_functions_2_intel<'a, 'tcx>(
|
||||
&mut self,
|
||||
bx: &Builder<'a, 'tcx>,
|
||||
to_zombie: Word,
|
||||
) {
|
||||
pub fn require_integer_functions_2_intel(&mut self, bx: &Builder<'_, '_>, to_zombie: Word) {
|
||||
if !self.integer_functions_2_intel {
|
||||
self.integer_functions_2_intel = true;
|
||||
if !bx
|
||||
|
@ -319,7 +319,7 @@ impl<'a, 'tcx> ArgAbiMethods<'tcx> for Builder<'a, 'tcx> {
|
||||
idx: &mut usize,
|
||||
dst: PlaceRef<'tcx, Self::Value>,
|
||||
) {
|
||||
fn next<'a, 'tcx>(bx: &mut Builder<'a, 'tcx>, idx: &mut usize) -> SpirvValue {
|
||||
fn next(bx: &mut Builder<'_, '_>, idx: &mut usize) -> SpirvValue {
|
||||
let val = bx.function_parameter_values.borrow()[&bx.current_fn.def(bx)][*idx];
|
||||
*idx += 1;
|
||||
val
|
||||
|
@ -114,11 +114,7 @@ use std::io::Write;
|
||||
use std::path::Path;
|
||||
use std::sync::Arc;
|
||||
|
||||
fn dump_mir<'tcx>(
|
||||
tcx: TyCtxt<'tcx>,
|
||||
mono_items: &[(MonoItem<'_>, (Linkage, Visibility))],
|
||||
path: &Path,
|
||||
) {
|
||||
fn dump_mir(tcx: TyCtxt<'_>, mono_items: &[(MonoItem<'_>, (Linkage, Visibility))], path: &Path) {
|
||||
create_dir_all(path.parent().unwrap()).unwrap();
|
||||
let mut file = File::create(path).unwrap();
|
||||
for &(mono_item, (_, _)) in mono_items {
|
||||
@ -384,9 +380,9 @@ impl WriteBackendMethods for SpirvCodegenBackend {
|
||||
}
|
||||
|
||||
impl ExtraBackendMethods for SpirvCodegenBackend {
|
||||
fn codegen_allocator<'tcx>(
|
||||
fn codegen_allocator(
|
||||
&self,
|
||||
_: TyCtxt<'tcx>,
|
||||
_: TyCtxt<'_>,
|
||||
_: &str,
|
||||
_: AllocatorKind,
|
||||
_: AllocatorKind,
|
||||
|
@ -27,8 +27,8 @@ use std::iter;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::sync::Arc;
|
||||
|
||||
pub fn link<'a>(
|
||||
sess: &'a Session,
|
||||
pub fn link(
|
||||
sess: &Session,
|
||||
codegen_results: &CodegenResults,
|
||||
outputs: &OutputFilenames,
|
||||
crate_name: &str,
|
||||
@ -380,9 +380,9 @@ fn do_spirv_val(
|
||||
}
|
||||
}
|
||||
|
||||
fn link_local_crate_native_libs_and_dependent_crate_libs<'a>(
|
||||
fn link_local_crate_native_libs_and_dependent_crate_libs(
|
||||
rlibs: &mut Vec<PathBuf>,
|
||||
sess: &'a Session,
|
||||
sess: &Session,
|
||||
crate_type: CrateType,
|
||||
codegen_results: &CodegenResults,
|
||||
) {
|
||||
|
@ -628,8 +628,8 @@ impl fmt::Display for SpirvTypePrinter<'_, '_> {
|
||||
|
||||
impl SpirvTypePrinter<'_, '_> {
|
||||
fn display(&self, stack: &mut Vec<Word>, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
fn ty<'tcx>(
|
||||
cx: &CodegenCx<'tcx>,
|
||||
fn ty(
|
||||
cx: &CodegenCx<'_>,
|
||||
stack: &mut Vec<Word>,
|
||||
f: &mut fmt::Formatter<'_>,
|
||||
ty: Word,
|
||||
|
Loading…
Reference in New Issue
Block a user