| Age | Commit message (Collapse) | Author | Lines |
|
|
|
- moving infaillible lint to prevent collisions
|
|
- Lint name: MATCH_SINGLE_BINDING
|
|
Use `checked_sub` to avoid index out of bounds
(Fixes) #4681 (possibly)
The issue likely occurs due to `lit_snip.len() < suffix.len() + 1`. You can see similar backtrace to change it to `lit_snip.len() - suffix.len() - 1000` or something then run `cargo test --release`.
But I couldn't come up with the test so I'd leave the issue open if we want.
changelog: Fix potential ICE in `misc_early`
|
|
|
|
|
|
Tweak documentation in `multiple_crate_versions`
This example isn't reproducible now since `ctrlc` upgrades `winapi` to `0.3.x` in `3.1.1`. We should pin their versions to trigger lint correctly.
changelog: none
|
|
|
|
|
|
|
|
|
|
|
|
Fix syntax highlighting of code fences
The documentation for RESULT_EXPECT_USED includes this code:
let res: Result<usize, ()> = Ok(1);
res?;
# Ok::<(), ()>(())
Because the code fence didn't start with `rust`, the code wasn't highlighted and the line starting with `#` was displayed on the website. This is now fixed.
EDIT: I noticed that highlighting for some other lints is broken as well. It only works if the code fence looks like this:
````markdown
```rust
// ..
```
````
However, many code blocks were ignored. I un-ignored most code blocks and made them compile by adding hidden code with `#`. While doing so, I found two mistakes:
```rust
opt.map_or(None, |a| a + 1)
// instead of
opt.map_or(None, |a| Some(a + 1))
```
and
```rust
fn as_str(self) -> &str
// instead of
fn as_str(self) -> &'static str
```
changelog: none
|
|
|
|
|
|
The documentation for RESULT_EXPECT_USED includes this code:
let res: Result<usize, ()> = Ok(1);
res?;
# Ok::<(), ()>(())
Because the code fence didn't start with `rust`, the code wasn't highlighted and the line starting with `#` was displayed on the website. This is now fixed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Clean up `span_lint` in `methods/mod.rs`
Uses `span_help_and_lint` instead of `span_lint` and `span_lint_and_sugg` instead of `span_lint_and_then`.
changelog: none
|
|
|
|
|
|
dont fire `possible_missing_comma` if intendation is present
Closes #4399
changelog: dont fire `possible_missing_comma` if intendation is present
I suspect there is already a utils function for indentation (but searching indent didn't yield a function for that), and my solution is certainly not universal, but it's probably the best we can do.
|
|
|
|
add size parameter for `vec_box` lint
changelog: add size threshold for the `vec_box` lint, currently 4096 bytes (one page) (subject to change). Closes #3547.
diff is a little bit confusing due to some refactoring (moving free functions to lint struct functions), relevant portion is [this](https://github.com/rust-lang/rust-clippy/compare/master...Areredify:vec_box_threshold?expand=1#diff-1096120ca9143af89dcc9175ea92b54aR294-R298). In hindsight should've been different commits, but oh well.
|
|
|
|
improve `empty_enum` documentation
closes #4905
changelog: improve `empty_enum` help message and documentation.
|
|
|
|
|
|
|
|
Lint vectored IO in unused_io_amount lint
`read_vectored` & `write_vectored` require handling returned value likewise non-vectored methods. https://github.com/rust-lang/rust/issues/68041
---
changelog: lint vectored IO in `unused_io_amount` lint
|
|
disable let_underscore_must_use in external macros
changelog: disable let_underscore_must_use in external macros
Closes #4980
|
|
|
|
|
|
|
|
|
|
r=phansch
Detect usage of invalid atomic ordering in memory fences
Detect usage of `core::sync::atomic::{fence, compiler_fence}` with `Ordering::Relaxed` and suggest valid alternatives.
changelog: Extend `invalid_atomic_ordering` to lint memory fences
Fixes #5026
|
|
Add `skip_while_next` lint
Fixes #4036
changelog: Add `skip_while_next` lint
|
|
Improve `suspicious_map`documentation
Fixes #4793
changelog: none
|
|
|
|
|
|
|
|
|
|
Avoid mut_key on types of unknown layout
This fixes #5020 by requiring a known layout for the key type before linting. Edit: This fixes #5043, too.
changelog: none
|
|
|