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

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

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

add lint for prevent global import 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 - 1 comment - A-style E-easy T-AST

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

detect #[allow(warnings)] and issue an unsilenceable warning rust-lang/rust-clippy

because if you use clippy, you opt in to warnings, why would you opt out again?

Created - 1 comment - C-needs-discussion T-AST good first issue hacktoberfest

Warn methods in doc comments written as `fun()` instead of `fun` rust-lang/rust-clippy

According to [#41771 (comment)](https://github.com/rust-lang/rust/pull/41771#discussion_r115144707), the current convention for rustdoc is to write methods without any trailing parentheses. For exa...

Created - 1 comment - A-style E-easy L-documentation T-AST

Possible suggestion improvements on match_ref_pats rust-lang/rust-clippy

Another example from [Carboxyl](https://github.com/aepsil0n/carboxyl/blob/master/src/transaction.rs#L118): ``` match &mut *current.borrow_mut() { &mut Some(ref mut trans) => ac...

Created - 2 comments - E-easy L-enhancement T-AST

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

Lint `'static` lifetimes in the type of statics/consts rust-lang/rust-clippy

see https://github.com/rust-lang/rust/pull/41957#discussion_r116365381 for an example RFC 1623 allows writing `const FOO: &str = "bar"` instead of `const FOO: &'static str = "bar"`

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

lint `(&foo).bar` rust-lang/rust-clippy

There's no reason to ever do this. it's probably a refactoring fallout.

Created - 2 comments - A-unnecessary L-lint T-AST good first issue

A lint for `as` casts rust-lang/rust-clippy

There should be a lint which warns on uses of `as` which does not involve pointers and are not in constants.

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

Naming convention rust-lang/rust-clippy

At work I have a VS plugin warning about names such as `TOMLParser`. [According to Rust's naming conventions, this should be `TomlParser`.](https://github.com/rust-lang/rfcs/blob/master/text/0430-f...

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

Result depending on execution order rust-lang/rust-clippy

In Rust issue [#28160](https://github.com/rust-lang/rust/issues/28160), Niko shows an example containing the line `x += { x = 20; 2 }`, and asks the question what execution order should be used. I...

Created - 5 comments - E-easy E-medium L-lint T-AST

Lint suggestion: benchmarks in main crate code rust-lang/rust-clippy

Benchmarks in main crate code mean that the whole code has to opt into `test`. Also, in any cargo project, benchmark files can be put into the `benches` folder, which is a much more appropriate pl...

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

lint `From<&str>` or `From<String>` implementations rust-lang/rust-clippy

suggest implementing `FromStr` instead Why is this bad: Usually not all strings represent correct values, so using `FromStr` allows us to return a `Result` that includes error information.

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

lint `&ref x` patterns, they could be just `x` rust-lang/rust-clippy

Example: ```rust let mut v = Vec::<String>::new(); let _ = v.iter_mut().filter(|&ref a| a.is_empty()); ``` could just be `|a| a.is_empty()`

Created - 5 comments - A-unnecessary C-assigned E-easy L-lint T-AST

panic_params: Don't lint non-format-string `{}` rust-lang/rust-clippy

```c ± cargo --version cargo 0.19.0-nightly (03efb7fc8 2017-04-23) ± rustc --version rustc 1.18.0-nightly (94e884b63 2017-04-27) ± cargo clippy --version 0.0.128 ``` The follo...

Created - 5 comments - A-musing E-easy L-bug T-AST

use statements anywhere but top of module rust-lang/rust-clippy

In an earlier version of sokoban-rs, the author included a `use` statement in the middle of a loop. Let's catch such stuff and propose putting it at the top of the file.

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

Lint non-expressive variable names rust-lang/rust-clippy

So, I've recently had to deal with code written in ▊▊▊▊▊ and for some reason the original authors of the software tended to use either one-letter variables or weirdly long names (that were not even...

Created - 6 comments - A-style E-easy L-lint T-AST T-middle

Lint against redundant field names in struct literals 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 - 6 comments - A-style A-unnecessary L-lint T-AST good first issue

LOC of individual functions rust-lang/rust-clippy

It would be great to have a lint for "long functions". That means the lint would count the number of lines (without comments) for each function and print a warning if it is larger than some value. ...

Created - 6 comments - E-hard T-AST good first issue

Option<Option<_>> rust-lang/rust-clippy

I don't know if it's used anywhere, but it does seem like misuse.

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

x..(y+1) reads better as x...y rust-lang/rust-clippy

Once we have inclusive ranges (which won't be too long; the RFC has recently been accepted), I think we should advise people to use them. Perhaps we could also check for `x...(y-1)` while we're at...

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

Suggest to insert underscores into long numeric literals rust-lang/rust-clippy

I don't even know what `61864918973511` is, but `61_864_918_973_511` I can quickly count to be 61 Trillion (In case I got the US naming scheme right. In germany it would be a Billion).

Created - 8 comments - A-style E-easy L-lint T-AST

unnecessary parentheses around range literals rust-lang/rust-clippy

I recently noticed that range literals don't need parentheses, unless their methods are used. I think that getting rid of those unneeded parenthesis makes for less cluttered, thus more readable co...

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

Lint for warning on division of integer literals rust-lang/rust-clippy

It would be nice to warn the user if they wrote an expression like `1/2` and meant `0.5`. There is also an open issue for this in Rust: https://github.com/rust-lang/rust/issues/21737

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

Displaying all 30 issues

License

Language