Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reenable clippy's use_self lint (disabled during last rustup) and remove now-unneeded #[allow]s for it. #470

Merged
merged 2 commits into from
Mar 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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