about summary refs log tree commit diff
path: root/clippy_lints/src
AgeCommit message (Collapse)AuthorLines
2020-02-04Add wild and struct handlingThibsG-29/+59
2020-02-04Use span_lint_and_sugg + move infaillible lintThibsG-105/+116
- moving infaillible lint to prevent collisions
2020-02-04Add new lint: match with a single binding statementThibsG-4/+59
- Lint name: MATCH_SINGLE_BINDING
2020-02-03Auto merge of #5129 - JohnTitor:use-checked-sub, r=flip1995bors-3/+11
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`
2020-02-03improve 'iter_nth_zero' documentationAreredify-2/+3
2020-02-03Use `checked_sub` to avoid index out of boundsYuki Okushi-3/+11
2020-02-02Auto merge of #5119 - JohnTitor:tweak-doc, r=flip1995bors-3/+3
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
2020-02-02Rustup to rust-lang/rust#68133Yuki Okushi-2/+6
2020-02-01Pin versions to trigger lint correctlyYuki Okushi-3/+3
2020-01-31Move debug_assertions_with_mut_call to nurseryflip1995-3/+2
2020-01-31Don't trigger `debug_assert_with_mut_call` on `.await`flip1995-1/+3
2020-01-31Small refactor of mutable_debug_assertionsflip1995-24/+24
2020-01-30Auto merge of #5110 - Aloso:patch-1, r=flip1995bors-24/+50
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
2020-01-30Un-ignore most code blocks to render correctly on website, correct mistakesLudwig Stecher-21/+47
2020-01-30Fix code formatting for more lintsLudwig Stecher-9/+9
2020-01-30Fix syntax highlighting of code fenceLudwig Stecher-1/+1
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.
2020-01-30lint all guard types, not just lock functionsAreredify-41/+41
2020-01-30decouple 'let_underscore' testsMikhail Babenko-1/+1
2020-01-30add lintMikhail Babenko-18/+67
2020-01-30Reformat code.xiongmao86-5/+5
2020-01-30Declare lint and implement lint logic.xiongmao86-0/+66
2020-01-29Rustup to rust-lang/rust#68512Yuki Okushi-1/+1
2020-01-27Rename `span_note_and_lint` to `span_lint_and_note`Yuki Okushi-26/+26
2020-01-27Rename `span_help_and_lint` to `span_lint_and_help`Yuki Okushi-87/+87
2020-01-26Auto merge of #5084 - JohnTitor:clean-up-span-lint, r=flip1995bors-52/+52
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
2020-01-26Don't use ExpnKind::descr to get the name of a bang macro.Eduard-Mihai Burtescu-13/+13
2020-01-26Apply review commentsYuki Okushi-13/+13
2020-01-25Auto merge of #5083 - Areredify:issue-4399, r=flip1995bors-16/+22
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.
2020-01-25dont fire possible_missing_comma if intendation is presentMikhail Babenko-16/+22
2020-01-25Auto merge of #5081 - Areredify:vec_box_threshold, r=flip1995bors-182/+203
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.
2020-01-25add size parameter for lintMikhail Babenko-182/+203
2020-01-24Auto merge of #5087 - Areredify:issue-4905, r=phanschbors-4/+18
improve `empty_enum` documentation closes #4905 changelog: improve `empty_enum` help message and documentation.
2020-01-24don't fire empty_loop in no_std cratesMikhail Babenko-15/+17
2020-01-24improve empty_enum documentationMikhail Babenko-4/+18
2020-01-24Clean up `methods/mod.rs`Yuki Okushi-52/+52
2020-01-24Auto merge of #5027 - sinkuu:vectored_io, r=phanschbors-10/+15
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
2020-01-23Auto merge of #5082 - Areredify:issue-4980, r=flip1995bors-0/+5
disable let_underscore_must_use in external macros changelog: disable let_underscore_must_use in external macros Closes #4980
2020-01-23disable let_underscore_must_use in external macrosMikhail Babenko-0/+5
2020-01-23add `option_as_ref_deref` lintAreredify-1/+113
2020-01-22Ignore macros with `!` operators in `eq_op`Yuki Okushi-1/+13
2020-01-22Rustup to rust-lang/rust#68140Yuki Okushi-2/+2
2020-01-21Auto merge of #5028 - krishna-veerareddy:issue-5026-mem-ordering-fences, ↵bors-33/+64
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
2020-01-20Auto merge of #5067 - JohnTitor:lint-skip-while-next, r=flip1995bors-0/+46
Add `skip_while_next` lint Fixes #4036 changelog: Add `skip_while_next` lint
2020-01-20Auto merge of #5070 - JohnTitor:suspicious-map-doc, r=flip1995bors-2/+3
Improve `suspicious_map`documentation Fixes #4793 changelog: none
2020-01-20Apply review commentYuki Okushi-3/+7
2020-01-20Improve `suspicious_map`documentationYuki Okushi-2/+3
2020-01-20Tweak wording in `assertions_on_constants`Yuki Okushi-4/+8
2020-01-20Add `skip_while_next` lintYuki Okushi-0/+42
2020-01-19Auto merge of #5056 - rust-lang:dissasociate-mut-key, r=flip1995bors-11/+14
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
2020-01-19Avoid mut_key on types of unknown layoutAndre Bogus-11/+14