First Pull Request


Lint: Multiple inherent impls rust-lang/rust-clippy

We may want to have a lint that checks for [multiple inherent impls](https://play.rust-lang.org/?gist=5798fd8736e09adb74da&version=stable). Why those are not problematic from a language standpoint,...

Created - 0 comments - E-easy L-lint T-AST

suggest struct constructor instead of mutable object + field mod rust-lang/rust-clippy

If you have a struct where all fields are public, then you should never do `let mut a = A::default(); a.x = 42;` but instead use a constructor with `.. A::default()` at the end: ``` rust #[derive(...

Created - 0 comments - E-easy L-lint T-AST

lint: transmuting known null pointer to ref rust-lang/rust-clippy

`mem::transmute(std::ptr::null())` – this is undefined behavior.

Created - 0 comments - E-easy L-lint T-AST

improve collapsible if in complex cases with same expressions rust-lang/rust-clippy

``` rust if a { if b { f(); } } else { f(); } ``` could be ``` rust if !a || b { f(); } ```

Created - 0 comments - E-easy L-enhancement L-lint

Lint std::panic::catch_unwind rust-lang/rust-clippy

<!-- Hi there! Whether you've come to make a suggestion for a new lint, an improvement to an existing lint or to report a bug or a false positive in Clippy, you've come to the right place. If you ...

Created - 0 comments - L-lint T-AST good first issue hacktoberfest

Lint: Implicit Deref rust-lang/rust-clippy

Basically, an `#[allow]` by default lint that tells you when you are referencing a value implicitly (e.g. `String::new().chars()` is really `(*String::new()).chars()`. Rationale is that somebody o...

Created - 0 comments - E-easy L-lint T-middle

Lint to warn about str::as_ptr() usage in ffi call rust-lang/rust-clippy

Hello. It would be nice to have a warning when using `str::as_ptr()` in a ffi call instead of using `CStr`. For instance, in the following code: ``` rust unsafe { printf("Hello".as_ptr() as *cons...

Created - 0 comments - A-correctness E-easy L-lint T-middle

Lint suggestion: Useless explicit documentation link rust-lang/rust-clippy

Once [intra-rustdoc links](https://github.com/rust-lang/rfcs/blob/master/text/1946-intra-rustdoc-links.md) lands, many explicit links will become unnecessary. It would be very useful to have a lint...

Created - 0 comments - A-style L-lint good first issue

Suggest `resize` rather when pushing same item to vec rust-lang/rust-clippy

Example in https://github.com/Gymmasssorla/finshir/blob/eae5d0c6761f5558c8ed33ef098d8bd13a07e64f/src/testing/helpers.rs#L55-L61 When pushing the same item to vec. ```rust fn gen_portions() -...

Created - 0 comments - A-complexity L-lint good first issue

Suggestion: borrowing a RefCell in funarg position rust-lang/rust-clippy

<!-- Hi there! Whether you've come to make a suggestion for a new lint, an improvement to an existing lint or to report a bug or a false positive in Clippy, you've come to the right place. For ...

Created - 0 comments - L-lint T-middle good first issue

New lint: Use `Into`/`TryInto` in bounds as opposed to `From`/`TryFrom` rust-lang/rust-clippy

When writing generic bounds such as: ```rust fn foo<T>(a: T) where u32: From<T>; ``` `Into` should be preferred, like this: ```rust fn foo<T>(a: T) where T: Into<u32>; ``` Why the f...

Created - 0 comments - A-style L-lint good first issue

Calling `main` rust-lang/rust-clippy

Apart from special setups (which we could detect following attributes like `#![no_std]`), recursing into `main()` seems like an unintuitive antipattern we should be able to detect.

Created - 1 comment - C-assigned E-easy L-lint T-AST

lint: `spawn(|| ())` (spawn empty) rust-lang/rust-clippy

Does nothing, can be removed.

Created - 1 comment - E-easy L-lint T-AST

Lint x != _ || x != _ rust-lang/rust-clippy

Also probably `x == _ && x == _`. This is either a duplicate (if both `_` are equal) or always false (true for the former).

Created - 1 comment - A-correctness E-easy L-lint T-middle

lint long chains of into/float additions/multiplications rust-lang/rust-clippy

In generall, `(a+b+c)+(d+e+f)` is faster to compute than `a+b+c+d+e+f`, because the former reduces data dependencies, allowing the CPU to run additions in parallel. For float arithmetic, the tree-l...

Created - 1 comment - A-performance E-easy L-lint T-AST

useless op on lhs of integer division or modulo rust-lang/rust-clippy

`(x + n + y) % n` or `(x + n + y) / n` can simply be replaced by `(x + y) % n` or `(x + y) / n + 1` this isn't true for the following computations on unsigned integers: `(x + n - y) % n` or `...

Created - 1 comment - A-correctness A-unnecessary E-easy L-lint T-middle

Lint `HashMap<T, ZST>` where ZST is any zero sized type rust-lang/rust-clippy

The user should be using `HashSet<T>` instead and magically create the ZSTs out of thin air when needed (since they are all the same value anyway).

Created - 1 comment - A-unnecessary E-easy L-lint T-middle

Lint request: warn mutable range bound variable rust-lang/rust-clippy

Rust uses `..` as the syntactic sugar for range construct however it might be misused as a replacement for *for-loop* in C/C++: the range bounds (`start`/`end`) are captured at the site of the rang...

Created - 1 comment - A-correctness E-easy L-lint T-middle

Lint `as_ref` on `&[u8]` rust-lang/rust-clippy

This is a nop and most likely a remnant of refactoring. Even better would be detecting `as_ref` on `&T` that yields `&T`

Created - 1 comment - A-unnecessary E-easy L-lint T-middle

Warn about useless matches rust-lang/rust-clippy

Clippy should warn about this useless match: ```rust fn main() { let a = 1; let b = 2; let c = 3; match (a, b, c) { (x, y, z) => { // this is a ...

Created - 1 comment - A-complexity A-style A-suggestion L-lint good first issue

Lint suggesting from_fn instead of while let Some(x) rust-lang/rust-clippy

With the release of 1.34 with the `from_fn` function, I'd like to propose a new lint that matches: `while let Some(x) = expr` and suggests replacing it with `for x in from_fn(|| expr)`. (With a spe...

Created - 1 comment - A-style A-suggestion L-lint good first issue

New lint: Pass references when possible for large data types? rust-lang/rust-clippy

<!-- Hi there! Whether you've come to make a suggestion for a new lint, an improvement to an existing lint or to report a bug or a false positive in Clippy, you've come to the right place. For ...

Created - 1 comment - A-performance A-suggestion L-lint good first issue

New lint: suggest using fs::{read,read_to_string} over File counterparts rust-lang/rust-clippy

In specific, we recommend to use: * `std::fs::read_to_string` over `File::read_to_string` * `std::fs::read` over `File::read_to_end` But only when buffer is empty.

Created - 1 comment - A-complexity L-lint good first issue

Lint for Unnecessary Map rust-lang/rust-clippy

It woud be nice if clippy could detect situations where `map()` is being used unnecessarily to pass a contained value wrapped as either a Result or an Option. ### Unnecessarry ``` rust let mut fil...

Created - 2 comments - A-unnecessary E-easy L-lint T-middle

Lint unwrap in drop impls rust-lang/rust-clippy

Would it make sense to deny panic-able fns in `Drop::drop` implementations? It recently came up in <https://github.com/diesel-rs/diesel/pull/641#discussion_r100066589>.

Created - 2 comments - A-correctness E-easy E-hard L-lint T-middle

Lint for iterating over a slice with one (or zero) element rust-lang/rust-clippy

<!-- Hi there! Whether you've come to make a suggestion for a new lint, an improvement to an existing lint or to report a bug or a false positive in Clippy, you've come to the right place. If y...

Created - 2 comments - A-unnecessary E-easy L-lint T-middle

Lint direct calls to `deref` or `deref_mut` rust-lang/rust-clippy

Instead of calling `x.deref()` or `x.deref_mut()`, `&*x` and `&mut *x` should be recommended instead.

Created - 2 comments - A-style E-easy L-lint T-middle

Always true expressions in if expressions rust-lang/rust-clippy

<!-- Hi there! Whether you've come to make a suggestion for a new lint, an improvement to an existing lint or to report a bug or a false positive in Clippy, you've come to the right place. If y...

Created - 2 comments - A-correctness good first issue hacktoberfest L-lint T-middle

Warn about uses of Rust types where a C (raw) type is expected rust-lang/rust-clippy

I started using Rust on ARMv7 and run twice into issues where Rust types where used instead of `c_*` types. 1. It should not be possible to use a C type in a function declaration and a Rust type...

Created - 2 comments - A-correctness E-hard good first issue hacktoberfest L-lint T-AST

Displaying issues 1 - 30 of 103 in total

License

Language