Skip to content

Commit d574fa3

Browse files
authored
Reenable clippy's use_self lint (disabled during last rustup) and remove now-unneeded #[allow]s for it. (#470)
* Reenable clippy's `use_self` lint (was disabled during last rustup). * Remove now-unneeded `#[allow(clippy::use_self)]`.
1 parent 7723f5d commit d574fa3

File tree

4 files changed

+6
-9
lines changed

4 files changed

+6
-9
lines changed

crates/rustc_codegen_spirv/src/decorations.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
//! SPIR-V decorations specific to `rustc_codegen_spirv`, produced during
22
//! the original codegen of a crate, and consumed by the `linker`.
33
4+
// FIXME(eddyb) Remove when a fix for clippy warning in `serde` derives
5+
// (https://github.com/rust-lang/rust-clippy/issues/6818) lands in nightly.
6+
#![allow(clippy::use_self)]
7+
48
use rspirv::dr::{Instruction, Module, Operand};
59
use rspirv::spirv::{Decoration, Op, Word};
610
use rustc_span::{source_map::SourceMap, FileName, Pos, Span};

crates/rustc_codegen_spirv/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@
2828
//clippy::enum_glob_use,
2929
clippy::pub_enum_variant_names,
3030
clippy::mem_forget,
31-
// See: https://github.com/EmbarkStudios/rust-gpu/issues/459
32-
// clippy::use_self,
31+
clippy::use_self,
3332
clippy::filter_map_next,
3433
clippy::needless_continue,
3534
clippy::needless_borrow,

crates/rustc_codegen_spirv/src/linker/specializer.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ impl TryFrom<&Operand> for CopyOperand {
290290
}
291291

292292
impl From<CopyOperand> for Operand {
293-
fn from(op: CopyOperand) -> Operand {
293+
fn from(op: CopyOperand) -> Self {
294294
match op {
295295
CopyOperand::IdRef(id) => Self::IdRef(id),
296296
CopyOperand::StorageClass(s) => Self::StorageClass(s),
@@ -325,8 +325,6 @@ enum Value<T> {
325325
SameAs(T),
326326
}
327327

328-
// FIXME(eddyb) clippy bug suggests `Self` even when it'd be a type mismatch.
329-
#[allow(clippy::use_self)]
330328
impl<T> Value<T> {
331329
fn map_var<U>(self, f: impl FnOnce(T) -> U) -> Value<U> {
332330
match self {
@@ -363,8 +361,6 @@ struct Instance<GA> {
363361
generic_args: GA,
364362
}
365363

366-
// FIXME(eddyb) clippy bug suggests `Self` even when it'd be a type mismatch.
367-
#[allow(clippy::use_self)]
368364
impl<GA> Instance<GA> {
369365
fn as_ref(&self) -> Instance<&GA> {
370366
Instance {

crates/rustc_codegen_spirv/src/symbols.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,6 @@ const EXECUTION_MODES: &[(&str, ExecutionMode, ExecutionModeExtraDim)] = {
323323
]
324324
};
325325

326-
// FIXME(eddyb) clippy bug suggests `Self` even when it couldn't possibly work.
327-
#[allow(clippy::use_self)]
328326
impl Symbols {
329327
fn new() -> Self {
330328
let builtins = BUILTINS

0 commit comments

Comments
 (0)