about summary refs log tree commit diff
path: root/src/tools/clippy/tests
AgeCommit message (Collapse)AuthorLines
2020-11-19Remove the clippy::panic-params lint.Mara Bos-89/+0
Rustc itself now warns for all cases that triggered this lint.
2020-11-05Merge commit 'b20d4c155d2fe3a8391f86dcf9a8c49e17188703' into clippyupflip1995-342/+1688
2020-10-28Merge commit '645ef505da378b6f810b1567806d1bcc2856395f' into clippyupEduardo Broto-98/+1452
2020-10-26Remove lint from clippyNathan Whitaker-70/+0
2020-10-23Merge commit 'bf1c6f9871f430e284b17aa44059e0d0395e28a6' into clippyupEduardo Broto-132/+956
2020-10-22Fix clippy testsvarkor-0/+3
2020-11-17Fix handling of panic callsCamelid-13/+48
This should make Clippy more resilient and will unblock #78343. This PR is made against rust-lang/rust to avoid the need for a subtree sync at @flip1995's suggestion in rust-lang/rust-clippy#6310.
2020-11-14Auto merge of #78809 - vn-ki:fix-issue-76064, r=oli-obkbors-16/+2
add error_occured field to ConstQualifs, fix #76064 I wasn't sure what `in_return_place` actually did and not sure why it returns `ConstQualifs` while it's sibling functions return `bool`. So I tried to make as minimal changes to the structure as possible. Please point out whether I have to refactor it or not. r? `@oli-obk` cc `@RalfJung`
2020-11-13update clippy test ouputVishnunarayan K I-16/+2
2020-11-11Implement destructuring assignment for structs and slicesFabian Zaiser-7/+22
Co-authored-by: varkor <github@varkor.com>
2020-10-16Rollup merge of #77493 - ↵Dylan DPC-0/+2
hosseind88:ICEs_should_always_print_the_top_of_the_query_stack, r=oli-obk ICEs should always print the top of the query stack see #76920
2020-10-14fix stderr file of clippy/custom_ice_message testhosseind88-1/+1
2020-10-09add new linehosseind75-1/+1
2020-10-09fix clippy custom_ice_message testhosseind75-0/+2
2020-10-09Merge commit '2f6439ae6a6803d030cceb3ee14c9150e91b328b' into clippyupflip1995-236/+660
2020-10-04Prevent forbid from being ignored if overriden at the same level.Felix S. Klock II-13/+4
That is, this changes `#[forbid(foo)] #[allow(foo)]` from allowing foo to forbidding foo.
2020-10-02Deprecate clippy lintMichael Howell-25/+8
2020-09-24Merge commit 'e636b88aa180e8cab9e28802aac90adbc984234d' into clippyupflip1995-657/+2089
2020-09-20Update Clippy testcasesChristiaan Dirkx-65/+91
Update the test `redundant_pattern_matching`: check if `is_some` and `is_none` are suggested within const contexts.
2020-09-20Auto merge of #76136 - CDirkx:const-result, r=dtolnaybors-183/+93
Stabilize some Result methods as const Stabilize the following methods of Result as const: - `is_ok` - `is_err` - `as_ref` A test is also included, analogous to the test for `const_option`. These methods are currently const under the unstable feature `const_result` (tracking issue: #67520). I believe these methods to be eligible for stabilization because of the stabilization of #49146 (Allow if and match in constants) and the trivial implementations, see also: [PR#75463](https://github.com/rust-lang/rust/pull/75463) and [PR#76135](https://github.com/rust-lang/rust/pull/76135). Note: these methods are the only methods currently under the `const_result` feature, thus this PR results in the removal of the feature. Related: #76225
2020-09-20Update Clippy testcasesChristiaan Dirkx-183/+93
Update the test `redundant_pattern_matching`: check if `is_ok` and `is_err` are suggested within const contexts. Also removes the `redundant_pattern_matching_const_result` test, as it is no longer needed.
2020-09-10Merge commit '5034d47f721ff4c3a3ff2aca9ef2ef3e1d067f9f' into clippyupflip1995-229/+805
2020-09-08Adjust Clippy for CONST_ITEM_MUTATION lintAaron Hill-45/+23
We no longer lint assignments to const item fields in the `temporary_assignment` lint, since this is now covered by the `CONST_ITEM_MUTATION` lint. Additionally, we `#![allow(const_item_mutation)]` in the `borrow_interior_mutable_const.rs` test. Clippy UI tests are run with `-D warnings`, which seems to cause builtin lints to prevent Clippy lints from running.
2020-09-02Improve recovery on malformed format callSasha-3/+3
If a comma in a format call is replaced with a similar token, then we emit an error and continue parsing, instead of stopping at this point.
2020-08-28Merge commit '3d0b0e66afdfaa519d8855b338b35b4605775945' into clippyupflip1995-321/+2318
2020-08-24Unbreak the clippy testScott McMurray-1/+3
2020-08-17clippy: support `QPath::LangItem`David Wood-7/+9
This commit updates clippy with the introduction of `QPath::LangItem` so that it still compiles. Signed-off-by: David Wood <david@davidtw.co>
2020-08-11Merge commit '09bd400243ed6f7059fedc0c1623aae3792521d6' into clippyupflip1995-364/+1363
2020-08-11Rollup merge of #75098 - Ryan1729:clippy-pointer-cast-lint-experiment, r=oli-obkDylan DPC-0/+236
Clippy pointer cast lint experiment This PR is an experiment about exposing more parts of `rustc_typeck` for use in `clippy`. In particular, the code that checks where a cast is valid or not was exposed, which necessitated exposing [`FnCtxt`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_typeck/check/struct.FnCtxt.html), and figuring out how to create an instance of that type inside `clippy`. This was prompted by [this clippy issue](https://github.com/rust-lang/rust-clippy/issues/2064). r? @oli-obk
2020-08-09add allow unused_unsafe and allow dead_codeRyan1729-10/+12
2020-08-09fix unary minus on usize and unused variable errors in .fixed fileRyan1729-32/+32
2020-08-09add a test example of where transmutes_expressible_as_ptr_casts should not ↵Ryan1729-2/+26
suggest anything
2020-08-08update stderr for transmutes_expressible_as_ptr_castsRyan1729-8/+8
2020-08-07Auto merge of #74821 - oli-obk:const_eval_read_uninit_fast_path, r=wesleywiserbors-21/+1
Check whether locals are too large instead of whether accesses into them are too large Essentially this stops const prop from attempting to optimize ```rust let mut x = [0_u8; 5000]; x[42] = 3; ``` I don't expect this to be a perf improvement without #73656 (which is also where the lack of this PR will be a perf regression). r? @wesleywiser
2020-08-06copy over *.fixed fileRyan1729-0/+77
2020-08-06Apply suggestions from code reviewRyan Wiedemann-0/+1
Co-authored-by: Philipp Krones <hello@philkrones.com>
2020-08-06add newline to transmutes_expressible_as_ptr_casts.rsRyan1729-1/+1
2020-08-06add extra error message to the expected stderr for ↵Ryan1729-1/+7
transmutes_expressible_as_ptr_casts test
2020-08-06add documentation to functions that call `do_check` and add a test against ↵Ryan1729-0/+11
lint ordering changing
2020-08-06get the expected number of errors by acknowledging that other lints are ↵Ryan1729-4/+61
covering the same ground
2020-08-06try putting the can_be_expressed_as_pointer_cast at the top and find that we ↵Ryan1729-2/+2
still get an ICE
2020-08-06write currently failing test for transmutes_expressible_as_ptr_castsRyan1729-1/+54
There are 5 errors, when there should be 7.
2020-08-06run cargo dev new_lint then move transmutes_expressible_as_ptr_casts into ↵Ryan1729-0/+5
transmute module
2020-08-02fix typosliuzhenyu-1/+1
2020-07-29Update clippy ui test.Oliver Scherer-21/+1
The reason we do not trigger these lints anymore is that clippy sets the mir-opt-level to 0, and the recent changes subtly changed how the const propagator works.
2020-07-26Merge commit 'da5a6fb1b65ec6581a67e942a3850f6bc15a552c' into clippyupflip1995-104/+344
2020-07-14Merge commit '2ca58e7dda4a9eb142599638c59dc04d15961175' into clippyupflip1995-191/+2315
2020-07-11Rollup merge of #72920 - oli-obk:const_transmute, r=RalfJungManish Goregaokar-9/+1
Stabilize `transmute` in constants and statics but not const fn cc #53605 (leaving issue open so we can add `transmute` to `const fn` later) Previous attempt: #64011 r? @RalfJung cc @rust-lang/wg-const-eval
2020-07-11Stabilize `transmute` in constants and statics but not const fnOliver Scherer-9/+1
2020-07-10Avoid "whitelist"Tamir Duberstein-2/+2
Other terms are more inclusive and precise.