Skip to content

Commit

Permalink
Reenable clippy's use_self lint (disabled during last rustup) and r…
Browse files Browse the repository at this point in the history
…emove 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)]`.
  • Loading branch information
eddyb authored Mar 4, 2021
1 parent 7723f5d commit d574fa3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
4 changes: 4 additions & 0 deletions crates/rustc_codegen_spirv/src/decorations.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
//! SPIR-V decorations specific to `rustc_codegen_spirv`, produced during
//! the original codegen of a crate, and consumed by the `linker`.
// FIXME(eddyb) Remove when a fix for clippy warning in `serde` derives
// (https://github.com/rust-lang/rust-clippy/issues/6818) lands in nightly.
#![allow(clippy::use_self)]

use rspirv::dr::{Instruction, Module, Operand};
use rspirv::spirv::{Decoration, Op, Word};
use rustc_span::{source_map::SourceMap, FileName, Pos, Span};
Expand Down
3 changes: 1 addition & 2 deletions crates/rustc_codegen_spirv/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
//clippy::enum_glob_use,
clippy::pub_enum_variant_names,
clippy::mem_forget,
// See: https://github.com/EmbarkStudios/rust-gpu/issues/459
// clippy::use_self,
clippy::use_self,
clippy::filter_map_next,
clippy::needless_continue,
clippy::needless_borrow,
Expand Down
6 changes: 1 addition & 5 deletions crates/rustc_codegen_spirv/src/linker/specializer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ impl TryFrom<&Operand> for CopyOperand {
}

impl From<CopyOperand> for Operand {
fn from(op: CopyOperand) -> Operand {
fn from(op: CopyOperand) -> Self {
match op {
CopyOperand::IdRef(id) => Self::IdRef(id),
CopyOperand::StorageClass(s) => Self::StorageClass(s),
Expand Down Expand Up @@ -325,8 +325,6 @@ enum Value<T> {
SameAs(T),
}

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

// FIXME(eddyb) clippy bug suggests `Self` even when it'd be a type mismatch.
#[allow(clippy::use_self)]
impl<GA> Instance<GA> {
fn as_ref(&self) -> Instance<&GA> {
Instance {
Expand Down
2 changes: 0 additions & 2 deletions crates/rustc_codegen_spirv/src/symbols.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,6 @@ const EXECUTION_MODES: &[(&str, ExecutionMode, ExecutionModeExtraDim)] = {
]
};

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

0 comments on commit d574fa3

Please sign in to comment.